Answer with a question; "Why would you want to know that?" or "What sort of a question is that?" work quite well - put the discomfort back onto the person asking the rude question.
Answer a rude question with complete silence. Just look at the person with blank expression, and say nothing. When they ask why you don't answer, say, "I just can't believe you asked that." Works every time.
Learn to recognise such behaviour as being borne out of the questioner's stress. They're stressed and they are looking to you to make them feel better - whatever you do, don't react! Their stress is their problem, do not take it personally.
Sometimes it's difficult not to react, especially when we're feeling low. At such times say, quite honestly and calmly, "I can't answer that just now, I'll get back to you." That will give you time to re-energise and deal with the question in an appropriate manner.
Once re-energised, you can truly ask them why they need to know. This will have the effect of either shutting them down completely (they weren't expecting an honest response) or opening up the dialogue on a positive platform (they had a valid, but badly communicated question).
I ask them to repeat the question. The person is obviously very insecure and wants to show someone up, so it is important that you turn this upon them with as much grace as you can. Mentally you can smack them with an invisible spade, but in reality, it is best to ask them to repeat the question. If they then do so, reply with "Why do you want to know?". This is polite, yet it will probably make the person blush - it will make them look rude and crass to the people around you. Ideally you want to avoid an argument, and so sometimes it is best just to reply: "Ask me no questions I'll tell you no lies." My Mother always used that on me, and I was always stumped. Good luck!
Just say loudly "Are you being rude?" in a self-righteous and direct tone, they ought to back down.
Alternatively, ask them to repeat the question louder, this'll make them self-conscious as other people may witness their rudeness!
Say "I beg your pardon?" very loudly and in your most politely discouraging tone of voice. This should make them embarassed and they probably won't want to repeat the question!
Some people are just open about things. In this case, being rude back isn't going to help anything except make you look awful. Just change the subject:
Miss A: "So did you ever sort out that fungal infection?"
Miss B: "Ha ha ha, how funny of you to ask. Actually, I've been meaning to ask you, how are the kids doing now after their chicken pox?"
Miss A: "Oh, they're much better..."
If someone has deliberately asked you a question to make you feel embarassed try to reply mildly and be blase. E.g:
Miss A: "I can't believe you're still wearing last seasons colours, don't you realise how dated you look?"
Miss B: "Ha ha ha. Actually, I've just bought a new car so I'm cutting back at the moment. And anyway, I only wear clothes that look good on me. I guess you don't follow that rule then?"
[walk away proudly, flick hair etc]
If they're trying to embarass you, give a very detailed, graphic answer! It'll throw them completely off guard and make them look stupid. Anyone around will be laughing with you, not at you.
Just stand back with a blank look on your face, maybe even one eyebrow raised and then look around at the other people present and give a slight laugh.. then say something patronising such as 'riiiight..?' This will make them feel stupid!
One simple word response: "WHY?"
That should be enough to shift the pressure onto the asker...and don't let them get away with answering "Becsause I want to know." Press on with "Why?"