If they barge in front of you at the till and pay by card, try and see the christian name on the card - let's say it's Jill. When they have paid and are just leaving the checkout shout out. "Hey Jill" Hearing their name they will stop and turn towards you. "Best of luck with the test results and good luck with the rash ointment!" For added pleasure smile and wave bye bye too.
Revenge is not worth it, they've only jumped a queue. Just thank your lucky stars that you never turned out that rude and ignorant about social courtesy.
simply tell them that you were in front of them very loudly it will embarass them and they not likely to argue, because everyone else probably is angry at them aswell, don't let them get away with it!!!
If you are with someone remark loudly on how annoying it is when you have waited for a long time and somebody thinks they can just barge in front of you. Works a treat with people who are up for New Year in Edinburgh and jump the bus queues ;)