I usually ignore them, but if they're persistent I laugh and make several sarcastic remarks. I don't find any point in attempting to reason with them or argue with them, so if they're going to continue to act as though they 'know it all,' I'll continue to not care. If they aim at me, however, it will become my aim to make them feel/look stupid by pointing out how little it actually matters.
A few well-placed, intelligent remarks and they forget how 'smart' they are. And if they don't, everyone around will know how dumb they appear.