I used to think like some other suggestions: ignore it, suck it up, or say something passive aggressive. But you know, over a long time, it started eating at me. Like I'm having to hide myself and pretend I'm someone else.
Now I just say it plain and clear, in the nicest way possible: "I know you're trying to be nice, but that statement/question really isn't." This is being true to what I really believe in that situation.