The actor and broadcaster, who worked with Gray for more than 20 years, said securing the role had helped him cope with his passing.
Stott, who joins BBC Scotland’s soap on Monday, said he thinks of his close friend and regular stage partner every time he arrives on the set of the show, which Gray starred in for two years.
Stott feels he has Gray’s “blessing” to follow in his footsteps after realising he had been “flying the flag” for him behind the scenes.
Stott said he had also spoken to Gray’s daughter Clare about the “strange” prospect of working on River City. He was asked whether he would consider joining the show in March, less than two months after Gray had passed away, only to discover his name had been put forward to producer Martin McCardie.
Stott, who appeared in Fringe shows and pantomimes with Gray every year, said: "I remember when Andy first got the job on River City. He was really excited because he knew the journey he was going to go on. He knew it would give him an opportunity to stretch his acting chops and threw himself right into it."We often laughed and joked about River City. He knew that I’d love to be in it. Ultimately, as I’ve now found out, he did have conversations about me coming in. As Andy was all throughout his friendship with me, he was really flying the flag for me there.”
Stott initially thought he was being asked to appear in a storyline to tie up “loose ends” with Gray’s character Pete Galloway, but was instead offered a new role as musician Sam Spiller, the long-lost father of Iain Robertson’s character Stevie O’Hara and former teenager lover of Scarlett O’Hara, played by Sally Howitt.
Stott added: "The one person that I absolutely wanted to phone was Andy."He was my go-to on so many levels in life, personally and professionally. I'm sure he would have been absolutely stoked that it has come to be.
"I spoke to Andy's daughter Clare, because it was a strange thing. I was getting this job opportunity and it was bittersweet because her dad wasn't there. She just told me it was fantastic and her dad would have been absolutely delighted. That was the kind of reassurance that I needed.
"Although I'm not getting to work with him this is kind of the closest that I could be to him. It's still a lovely way to have him in my life. I get to think of him every time I go on set or just before I do a scene - Andy is the one that I glance up to.
“It's really helped me a lot over the last few months to have this opportunity on a show that was so important to Andy and that he was so loved on, not just by the audience, but the people working on it.
"I’m inheriting that love and goodwill. I'll never be able to express how grateful I am to the team and how welcome they've made me feel."