It's happened to me a couple times, and I had two very different responses to each one.
The first one was a woman behind me in the pharmacy line who tapped me on the shoulder and asked me, "When are you due?" And she was completely serious, as far as I could tell. I simply told her I wasn't pregnant, and faced the pharmacy counter once more. She apologized, I said "That's all right." even though it wasn't, and that was the end of it.
The second one was a rather mean-spirited comment by an employee, though. They got rid of the Borders in our mall back when that chain still existed, and replaced it with a clothing store. I could tell before I went in that it was for people of a slimmer physique than I possessed, but I was Christmas shopping, and I thought I might find some gift ideas in there. The girl at the sales desk completely ignored me (which I didn't really notice at first), but greeted the next two customers, who were quite slender. I noticed that, but didn't really think anything of it until she finally began to look annoyed. Finally, the girl said to me, "Excuse me, but I really don't think we have anything here that would fit you." I realized I wasn't imagining an attitude where one didn't exist, and pasted on a fake smile, saying, "Actually, I'm doing my Christmas shopping. I think I'll look elsewhere, though, thanks." It worked out fine, because I found something similar to an item I'd had my eye on, for a better price, in another store.
I'd gotten comments like that all through middle and high school, so by that time I had a pretty thick skin. It makes me angry, though. Sometimes a person might not be able to regulate their weight for health reasons. I have an under-active thyroid, and can't lose weight no matter what I try!