Surrey 220 and 232 for 5 (Foakes 81*, Burns 74) lead Gloucestershire 326, Topley 5-66) by 126 runs
After Gloucestershire took a first-innings lead of 106, Surrey lost three for seven to slip to 48 for 3, still trailing by 58. But Burns, who made 74, and Foakes, unbeaten on 81 at the close, shared 97 for the fourth wicket.
Burns fell before tea and when David Payne bowled Jamie Smith with the last ball of the session, Surrey were 187 for 5, only 81 ahead. But Foakes and Jordan Clark took their side to the close still in the game.
It's been a difficult few months for Burns who never got going during last summer's internationals and whose paternity leave interrupted his winter with England that eventually saw him dropped for the final two Tests in India. A skittish dismissal in the first innings here was not the start to the season he envisaged but a 130-ball stay would have raised hopes of a return to form.
He began with two back-foot steers for four off Payne and punched the same bowler to deep square to raise fifty in 93 balls. He dismissal would have grated - top-edging a pull to sky a catch to long leg where Payne took a smart catch.
Burns guided Surrey through a concerning wobble as Mark Stoneman fell over trying to work Ryan Higgins to leg and departed lbw and Hashim Amla edged Matt Taylor behind for a 12-ball duck. Ollie Pope was also caught at the wicket to Taylor, again playing a loose drive, and Surrey were heading out of the contest.
But Foakes settled with Burns after lunch and the pair moved the visitors into the lead with Foakes passing fifty in 92 balls and will return on day four hoping to build the lead beyond 200. Surrey lost Burns and then Smith before tea, the latter to one from Payne that held its line from round the wicket, as Gloucestershire reclaimed the ascendency.
The hosts nudged their lead into three figures at the start of the day as Reece Topley added the wicket of Jack Taylor to claim 5 for 66 - his first five-wicket haul in a first-class match since 2014.