One ahead after an opening 63, former European No 1 Rafferty doubled his advantage at the East Lothian venue as he added a 67 on the Fidra Links for a 14-under-par total.
Bidding for his breakthrough win in the over-50s ranks, the Northern Irishman stormed four shots clear after he covered the opening six holes in three-under.
He was then caught by Luna, the 2013 winner, after the Spaniard eagled both the second and 11th before Rafferty birdied the 13th, 15th and 18th to open up a two-shot cushion in the title race.
“Leading with a round to go is new ground for me as it’s an awful long time ago that I was winning tournaments,” admitted the 51-year-old, who has seven European Tour titles to his name and topped the money-list in 1989.
“But, at the same time, this is the reason that we put ourselves in a position to compete and try to win tournaments.”
Luna, who landed his title triumph in this event at Fairmont St Andrews, holed from feet at the second for the first of his eagles before rolling in a 30-footer at the 11th.
“It’s the first time in my life that I’ve had two eagles in the one round,” said the 53-year-old from Madrid after signing for a 65 to back up an opening 67.
Luna, who won the 1995 Madeira Island Open on the European Tour, followed up his first over-50s success at St Andrews by winning the ISPS Handa PGA Seniors Championship in 2014.
All of those previous triumphs would be eclipsed if he comes out on top here due to one of his sons, 19-year-old Jorge, caddying for him.
“All my family is here and that helps me relax,” he said. “If I could do it here with them all here would be the best feeling in my life.
“It’s the best feeling you can have, to play good and have a win with someone from your family on your bag.”
Luna beat Tiger Woods by one shot at St Andrews as he helped Spain beat the US in the semi-finals of the 1998 Dunhill Cup before losing to South Africa in the title decider.
“That was a long time ago,” he admitted, smiling. “When we were in St Andrews earlier this year, I went to show Jorge my shot at 17 against Woods. I still have that feeling under my skin.
“Level with Tiger, I was behind the bunker and hit a flop shot up into the sky, over the bunker and stopped right at the flag. Tiger missed his putt and I was one shot ahead and I beat him by a shot.
“I couldn’t do that shot again. Now with my age, the hands are not the same.”
Australian Mike Harwood, runner-up to compatriot Ian Baker-Finch in the 1991 Open Championship at Royal Birkdale, sits third, three off the lead, after a 66 with former Ryder Cup captain Mark James a stroke further back following his 67.
Leading home hope Andrew Oldcorn dropped three shots in his last two holes to slip 10 off the lead, sitting joint-14th alongside compatriots Stephen McAllister (68) and Gordon Brand Jnr (69).
Paul Broadhurst, the defending champion and winner of last month’s Senior Open at Carnoustie, is 11 behind Rafferty after he signed for a disappoitning 73.
(GB&I unless stated)
130 Ronan Rafferty 63 67
132 Santiago Luna (Esp) 67 65
133 Mike Harwood (Aus) 67 66
134 Mark James 67 67
136 Philip Walton 64 72
137 Gary Wolstenholme 69 68; Paul Eales 68 69
139 Chris Williams (Rsa) 72 67; James Kingston (Rsa) 70 69; Gary Marks 69 70; Paul Wesselingh 69 70; Barry Lane 67 72; Peter Fowler 66 73
Selected other scores
140 Gordon Brand Jnr 71 69; Stephen McAllister 72 68; Andrew Oldcorn 68 72; Ian Woosnam 68 72
141 Paul Broadhurst 68 73
142 Ross Drummond 72 70
144 Sam Torrance 73 71
145 Bill Longmuir 71 74