People (for some weird reason) don't always realise without prompting that they're being offensive. So if you can hold back your own offendedness, it's worth pointing out first that what they've said is quite inappropriate, and why - because they may genuinely have just not thought it through. I get this a lot, people are so fascinated it overrides their sense of whether what they're asking is invasive, and they just need to be gently reminded, and are usually embarrassed and apologetic once they realise.
Of course, if they then continue to be offensive instead, you know they're doing it on purpose, and you can then slap them across the face with a really big fish, or whatever.