There's no easy answer to this, but I will say a couple of things.
First, that anyone who says something like that is a total ***.
Second, once people get to know you, they look past your physical appearance - it is only with strangers that this is a hindrance.
Third, that whenever you hear somebody say this, since this has happened to you multiple times, just say "eh, it's not like I haven't heard it before" and move on.
Fourth, that a LOT of people are ugly. Seriously, look around. You're not the only one.
Fifth, that most people really don't care how you look.
And lastly, that too much emphasis is placed on looks in the first place.
It always sucks to hear crap like that from people. Just don't let it get to you too much. There's no reason that you should have to feel that bad about how you look. It makes no sense at all.
Also, IMO, no one is ugly. It's easy as a woman to become convinced of this (and I'm not talking about the blond skinny idiots who think they are ugly). But the older I get the less I think it is true. Nothing wrong with being realistic, but don't be down on yourself either.