Yorkshire 307 (Wharton 69, Bess 66, Raine 4-64) and 132 for 4 (Lyth 53) lead Durham 427 (Gay 172, Lees 152, White 3-76) by 12 runs
Durham will hope the threat of fourth-afternoon weather does not ruin their chances of claiming a Rothesay County Championship victory over Yorkshire at the Banks Home Riverside.
Yorkshire can lay claim to having the better of day three thanks to taking the last nine first-innings wickets for 126 through until early afternoon, limiting the hosts to 427 all out in reply to 307. Alex Lees was removed for a standout 172 and Emilio Gay for an excellent 152.
New-ball seamer Jack White led the way with three wickets, but all five of the county's quicks struck, including New Zealand overseas debutant Ben Sears.
However, Durham chipped away at the second-innings wickets on a slow pitch, restricting Yorkshire to 132 for four from 59 overs at close. Their lead is only 12.
Former England Test opener Adam Lyth reached 15,000 first-class career runs amidst a patient 53 in the North East sunshine, while Ben Raine and Matthew Potts struck twice apiece.
Lees and Gay, who faced 240 and 239 balls respectively, completed a record second-wicket partnership of 279 - their county's highest ever for that particular wicket in first-class cricket.
That beat the 274 Scott Borthwick and Mark Stoneman that shared against Middlesex here in 2014.
Yorkshire hit back strongly during a morning which saw Durham advance from 264 for one overnight to 386 for six at lunch, with Lees and Gay both falling.
While Yorkshire started the day with the spin of Dom Bess, all five wickets fell to seam.
Matthew Revis is playing his first game since suffering a back stress fracture last August and struck twice in as many overs when he had Lees caught at long-leg following a top-edged pull and Colin Ackermann caught behind for a duck.
Ollie Robinson was trapped lbw by White, now bowling with the new ball, before Will Rhodes fell the same way to Sears, who earlier took a smart diving catch running in from long-leg to help Revis remove Lees.
Sandwiched in between the departures of Robinson and Rhodes, George Hill squared Gay up and rocked back his off stump shortly after the left-hander had reached his 150 off 235 balls.
And inside 10 overs of the afternoon, Durham had been bowled out, with White and Jordan Thompson striking twice apiece.
White bowled Raine and had Brendan Doggett caught behind, while Thompson struck twice in the 104th over to get Graham Clark caught at first slip for 33 and Paul Coughlin caught behind.
Coughlin batted lower down than usual at No. 10 because of an abdominal injury suffered whilst bowling on day one, leaving Durham a bowling option light second time around.
While the morning's play perhaps suggests otherwise, there isn't as much life in this Riverside pitch for the bowlers as there was on day one.
Yorkshire lost Fin Bean lbw early on to Raine's seam - 25 for one - before Lyth reached the 15,000-run mark with a trademark cover drive against Potts to move to 15 before tea.
Potts had James Wharton caught at deep square-leg following a miscued pull early in the evening as Yorkshire fell to 39 for two.
From there, Lyth and Dawid Malan dug in on a slow pitch to chip away at the deficit, sharing 75 for the third wicket. But both fell in the final hour to boost Durham's chances.
Lyth reached his fifty off 128 balls - his second of the season added to a century - but fell lbw to Raine with the deficit still six.
Potts then bowled Malan for 37, leaving Yorkshire at 117 for four.
Yorkshire captain Jonny Bairstow ended the day unbeaten on two.