Glad you asked...
The best way is to engage them in a conversation, look interested and enlightened when they speak. Then continue to ask more questions and after a while you will get them in a position where they have not done something or do not have the answer. This usually humbles them a bit.
Then again, this answer might help you...
I've always found that the best way to deal with pretentious people is to ignore them. Don't ask them how they're doing, how much something cost, or anything that allows them to brag. I like to express that I find pretentious people to be a bore. I prefer real people.

