"You," he said to Foster, "are the worst Rangers player ever."
Foster was momentarily taken aback, but then old instincts asserted themselves. Foster answered back.
"Why do you feel it's necessary to say that or that it's ok to say that?" Foster asked.
The response was that he was a fan, he paid his money at games, so he was entitled to his opinion.
"It got to the point that because I kept challenging him, somebody noticed and said that we need to get security because I was harassing him," Foster says with a look of incredulity.
"I got fixated on it and should have let it go, but I was just minding my own business, not walking about with a big sign saying, 'I'm the greatest'. Now, an hour later, I'm laughing at it and thinking it's ridiculous, but at the time it did annoy me.
"He'll maybe feel great when he tells his pals that he abused me. It's not nice. I love Glasgow, I love the people and I love living here, but I don't want to always be on my guard."
Moments of criticism have pockmarked Foster's career, and he admits that he finds it difficult to just brush them aside. He is not capable of the flippancy of some footballers, but his response is not born out of defensiveness either. When he feels that criticism is valid, Foster uses it for motivation.
There have been moments in his life when he feels that family time has been impinged upon. Last season, Foster took his son to the New Year carnival in Glasgow 24 hours after Rangers lost to Hibernian.
He returned home to find that he had been criticised by a Rangers fan on Twitter, but felt that was unfair since this was his Christmas time with his son, who lives with his mother.
"What do you want me to become, a hermit, and hand back the money I've earned because we got beaten?" Foster says. "You're going to lose games, but that doesn't mean I'm not trying or working hard; it's sometimes you play badly or have bad luck.
"There were a few occasions [as an Aberdeen player], one time when I was sitting with my parents and a couple of guys walked past and made a comment, but luckily I was the only one who heard it.
"I'm a great believer that that's my time with my family and if you want to make a comment at 3 o'clock on a Saturday, when you've paid your money to come to the game, then vent and tell me whatever it is you want to tell me.
"It's not just negative, people come up and ask for signatures and photographs and they're very complimentary. But the ones who are not are the ones that stick with you. It's not nice being told how rubbish you are.
"I'm pretty bad about going home and beating myself up about it, so the last thing I need is somebody else telling me how bad I was. But that's part of playing football."
Foster is a quick, industrious and earnest player, a winger in his youth who was converted into a full-back in his early days at Aberdeen out of necessity.  He was a boyhood Rangers fan who broke through at Pittodrie and contributed to the resurgence of the team under Jimmy Calderwood, but a clash of personalities with Mark McGhee led to Foster being loaned out to Rangers in the deal that took Andrius Velicka to Aberdeen.
Foster returned as a title winner, but the extent of the rivalry between the two sets of fans meant that his second spell at Aberdeen turned fraught, even when he was made captain by Craig Brown and Archie Knox.
"It was difficult, going back and then being made captain in the first pre-season game, a couple of the Aberdeen fans were singing songs and making comments about me and they were obviously not very happy that I'd played [for Rangers]," Foster said.
"I made a comment as I went off the pitch, and of course the fans are 100 yards away, the press are two feet away. It's mumbled almost to myself but they hear it and then it's a story."
There is an honest, engaging quality to Foster. He has played in major Champions League matches, captained Aberdeen and enjoyed a solid professional career, yet encountered plenty of jarring moments, too.
After a spell at Bristol City, he returned to Rangers and soon after signed up for Twitter, where he was immediately abused by the first person who responded to him.
"The guy said he would take great delight in watching me get hit by a bus, die in the street and he would revel in a party afterwards to celebrate," Foster says. "It was that absurd that I laughed to myself, I couldn't believe I was reading this.
"I don't understand the mentality of a person who would think, 'I've got five spare minutes, I'm going to go on Twitter and send this abuse to someone I've never met'. You look at his profile and he was relatively young, so the time I was at Aberdeen he was maybe 13, 14, so has he really seen me play and what's his motivation? Purely that I've signed for Rangers?
"I wouldn't say it to my worst enemy in the world. When it's criticism of how I've played, I can get over it and take it on board, but when it's abuse - you're rubbish, the worst player ever - it's a nothing comment, I can't do anything with that. It doesn't mean anything, but you can't get it out your head as quick."
Foster now spends his life between Elgin and Glasgow, where his girlfriend, the singer Amy Macdonald, lives. He is comfortable with the different pace of life as a Ross County player, and recalls fondly the memory of the couple going out for dinner in Inverness while he was still wearing his club tracksuit and not being stopped or approached by anybody.
At 30, he is young enough to hold at bay serious thoughts about life after retirement, although he is doing a psychology degree on the Open University - "to try to understand people". He is content with his life, having made much of his career, and the spikiness, the unwillingness to stand down, are simply aspects of his character.
They are shared in some senses with Macdonald, who has also had to develop coping mechanisms for living in the public eye. They react with anger at times, but are also able to see the black humour of the attention, like when Foster was booed by the Motherwell fans earlier this season.
"My girlfriend said to me, 'it's quite funny that you've managed to unite the whole of Scotland, everyone's going to boo you'," Foster said. "It does help [that] we're both used to that. I spoke to her after [the shopping incident] and she said the guy's lucky she wasn't there.
"She would laugh it off if it was against her but she's more protective with me. She can be very cutting and she's quick, so that guy today before he'd finished his sentence he would have felt pretty bad about himself."
Foster has earned the right to feel good about himself and his career.
During a recent shopping trip in Glasgow, Ricky Foster noticed a young man walk by with his friends and then turn back to approach him.