I worked retail once and a customer was very rude to me. When they left, my co-worker said to me, "I wonder what happened to them before they walked in our store to make them so sad?" Now, every time this happens to me I think about that.
Maybe earlier that day someone close to them fell ill. Maybe last week their dog had to be put down. Maybe their home is in foreclosure or their boyfriend just broke up with them. Maybe their back aches and they don't have insurance and can't see a doctor. Maybe their child needs new shoes for the basketball team and they don't have the money to buy them. Who knows what it is. It's just bad enough that they can't help but to take it out on you.
Thinking that makes you realize how important it is to show these strangers you're here for them. You're on their side. A smile or a please or a "that's a great necklace you have on today" could turn their day around. Be kind. It could make a world of difference to one person today.