Well, always level that person. And on ,,joke", say: Oh my gosh, whatever." and laugh. That will make them irritated and they will eventually get bored and stop.
My favorite is to raise my eyebrows at them and say: "Riiight...." or ,,Keep talking, one day you might say something smart".
But don't be mean back, or you're just as bad, or at anyone by embarrassing them, then it will never end.