Foakes faced 263 balls and was boosted by Ollie Pope (58) and Jordan Clark (50) as Surrey set their imposing target before making early inroads in the field before close.
Dom Sibley fell for a first-ball duck and skipper Will Rhodes also went for six as the hosts wobbled onto 16 for two in reply.
Matt Critchley scored a century on his Essex debut as the hosts built on their first-wicket platform of 220 to set a target of 514 against Kent at Chelmsford.
Critchley was the last man out on 132, adding to first-day centurions Sir Alastair Cook and Nick Browne as the hosts continued to punish the ailing Kent attack.
The visitors rallied in response and despite losing Daniel Bell-Drummond lbw on 11, Ben Compton’s unbeaten 47 helped them reach 122 for one at close.
Joe Weatherley scored a brilliant 168 as Hampshire amassed a first-innings lead of 248 against Somerset at Southampton.
Weatherley brought up his century in 179 balls as the hosts made short work of Somerset’s first innings total of 180, with both Ian Holland and James Vince striking supportive half-centuries.
Ben Green and Tom Lammonby survived six overs before close as Somerset ended the day 15 without loss.
Rob Keogh and Gareth Berg summoned a century stand for the eighth wicket to spare Northamptonshire a sizeable first-innings deficit against Gloucestershire at Wantage Road.
James Bracey followed his hundred in the visitors’ total of 223 with five dismissals as Northamptonshire were reduced to 129 for seven in reply.
But Keogh and Berg came together to steer their side to 288 – and there was still time to make inroads in the Gloucestershire attack as the visitors finished their second innings on five for one.
In Division Two, Brett D’Oliveira marked his first match as Worcestershire captain with a century to put the visitors in a strong position after two days of their match at Grace Road.
The 30-year-old struck an unbeaten 118 as the visitors posted a first innings total of 348, backed by half-centuries from Joe Leach (70) and Ed Barnard (37), before making early inroads into the Leicestershire attack.
The hosts made a calamitous start to their response, falling to six for three before a 26 from Lewis Hill helped them steady the ship as they limped to 42 for three at close.
Steven Finn took three wickets on his Sussex debut as the second day against Nottinghamshire at Hove finished finely poised.
Tom Clark squeezed in his maiden hundred before the hosts were bowled out for 375 on the stroke of lunch, then Finn stepped up to take the wickets of Haseeb Hameed and Joe Clarke as Notts slumped to 52 for four in response.
Finn also ended a fifth-wicket stand of 108 between Lyndon James and Steven Mullaney as Notts ended the day on 214 for five, a deficit of 161.
Tim Murtagh claimed the 900th first-class wicket of his career but Derbyshire made decent progress as they replied to Middlesex’s 401 on day two at Lord’s.
Shan Masood’s 91 for Derbyshire allowed the visitors to reach 177 for four after bowling out the hosts on the stroke of lunch, Alex Thomson returning four for 103 for his best figures in LV= County Championship cricket.
Resuming on 164 for four, Glamorgan slid to 234 all out against Durham before rain and hail signalled another early close in Cardiff.
Paul Coughlin took the wickets of Colin Ingram (87) and Chris Cooke (59) and the visitors only faced one over in reply, reaching five for no wicket before rain stopped play at lunch.