I suppose that would depend on the actual comment and the person making it. If the supposed comment is meant to be a joke, you could just say "that's not funny," and leave it at that. Hopefully they will know not to repeat that type of thing around you and will think twice about saying it in front of someone else. If they're serious about what they're saying, you could ask why they think what they do. Maybe they can be educated.
Of course, some people are just d!cks, so there may be nothing that you can do...