Some people can be extremely difficult to work with. I know, I'm one of them. I've found that there are four easy tactics that can be employed when dealing with those people who just rub you the wrong way.
Remain Stoic
Some people try to boss you around and act like they have authority that they don't. Whether or not their authority is legitimate, a good tactic is to resort to stoicism- the repression of emotion. In other words, be respectful and calm. Act as though their behavior is having no effect on you. I know you've all heard this before, but most bullies enjoy getting a rise out of their victims.
The Socratic Method
Some people enjoy putting you or your work down, and try to mask it with pleasantries. Play the game. Ask them what they can do, why they feel that way, etc. Bog them down with questions and find out exactly where they're coming from, and you can sometimes call their bluff.
Ignore Them
Sometimes the best method really is to just ignore the person altogether. If it's obvious that you don't like them and they don't like you, maybe it's best to just avoid each other whenever possible. When All Else Fails, Reason
Some mature adults are actually capable of being reasoned with. You can find out exactly why this person has a problem with you and try to work on it. Even just finding out what annoys your co-worker about you can give you some information about how to avoid setting them off.