I truly believe that we're all just trying to do our best with what we know. Very few people wake up in the morning and think "I'll make her feel bad today". Granted, there may some, but they're few and far between. I even think that people who are being mean don't know they're doing it. Or, if they do, they don't really know why they're doing it. That calls for some introspection time on their part.
That said, and with all the compassion and empathy in the world, you don't have buy into their drama. So I've come up with a few come back lines that might...
(a) make them realize they're actually out of line
(b) think twice before they make you the target of their issues
(c) explain themselves better
I don't advocate being unkind but I do think we need to reject criticism. So, here are a few tips, lines, and what-have-you.
First up, lines to use in any given situation. If you have a list top of mind you'll be ready when needed. All said with a hint of humor and a smile.
(1) I don't see how that's any of your business
(2) I'll be the judge of that
(3) Thanks for the warning
(4) Did I ask?
(5) You say it like it's a bad thing?
(6) WOW, you just cured me.
Next, perhaps a little more direct but still with the authentic intention of promoting better understanding of the current communication.
(1) I beg your pardon, can you repeat that?
(2) Are you trying to hurt my feelings?
(3) Did you mean to be so rude?
If this doesn't make someone address their communication with you, and respect your boundaries, then maybe they have big issues (possibly with you). But they're still THEIR issues, not yours. You may have to distance yourself and try to limit contact. Worse case scenario is that you go no contact. Depending on who they are in your life, this can be quite a drastic step, so search your soul, it may be for the best.