"Neither irony or sarcasm is argument," said novelist Samuel Butler. Although some would argue that Jon Stewart and Stephen Colbert have proved Samuel Butler wrong, in everyday conversation, sarcasm can be a passive-aggressive and hostile way of dealing with a larger issue. Although sarcastic statements can be funny, they are often devoid of humor for the person on the receiving end.
Consider the motive. Although sarcasm can be hostile, a touch of sarcasm, particularly when directed at a general topic rather than a specific person, can add wit and humor to a conversation. Some people who use sarcasm frequently don't intend their comments to be insulting. Sometimes, though, sarcasm can come from a place of insecurity and can result in others feeling hurt and put down. If this is the case, confront the commenter.
Confront the person directly by pointing out the motivation behind the behavior (i.e., "It sounds like you're upset that I arrived so late."). You might be tempted to reply with sarcasm, but such an approach could allow the conversation to deteriorate into passive-aggressive sparring. By confronting the person, you "call the person out" on the behavior and put the issue out in the open, demonstrating that you prefer to deal with problems in a more direct way.
If the person continues to be sarcastic, address the sarcastic behavior itself. Explain that you think the person is using sarcasm to hide issues or to make you feel inferior. Tell the person that you would like converse in a more straightforward manner, particularly if the comment is a complaint in disguise, which would be better dealt with directly.