Bairstow steadies England after South Africa's early strikes
England were 111 for three at the close of play with Bairstow on 38 not out and opener Zak Crawley playing a crucial supporting role on 17 from 77 balls.
The fourth-wicket partnership of 68 put England in a promising position after they had struggled early on, reeling at 43-3 after Joe Root was dismissed for nine.
South Africa were bowled out for 151 after losing five wickets before lunch, with England's James Anderson and Stuart Broad picking up three wickets apiece.
After such a low total, the touring side, who lead the three test series 1-0, knew they needed to deliver with the ball and they enjoyed early success when Alex Lees edged Lungi Ngidi to keeper Kyle Verreynne.
Anrich Nortje's pace was too much for Ollie Pope who was clean bowled by a delivery which nipped back off the seam.
Kagiso Rabada claimed the prize scalp of Root, who was caught by Sarel Erwee at the fourth attempt after juggling the ball at first slip.
The pressure was on the out-of-form Crawley but he played with focus and determination against both pace and the spin of Keshav Maharaj.
Bairstow was more confident and willing to play his shots but for all the talk of England's new cavalier style, this was an appropriately conservative approach.
South Africa had been rocking at 108 for eight before Rabada and Nortje added 35 for the ninth wicket -- the longest partnership of the innings.
DIFFICULT CONDITIONS
In the morning session, England removed the tourists' top order cheaply after South Africa skipper Dean Elgar won the toss and opted to bat despite what appeared difficult conditions following overnight rain.
Anderson, bowling on his home ground, found early movement off the seam and grabbed the breakthrough when he found Erwee's inside edge and wicketkeeper Ben Foakes dived to make a superb catch.
Anderson and Ollie Robinson were both beating the outside edge regularly and Robinson thought he had claimed the prize scalp of Elgar when Pope snaffled up a catch at short mid-on off the bat-pad, but the umpire signalled for a no ball.
Broad looked keen to get to work on an encouraging surface for seamers and took full advantage.
After two lbw decisions were turned down, Broad removed Elgar for 12 with a full-length delivery which was edged to Bairstow at third slip.
Broad removed Keegan Petersen for 21 in similar fashion with Root snaffling up the catch at first slip to leave South Africa on 41-3.
England skipper Ben Stokes brought himself into the attack and struck with his third delivery -- a loose short ball which Aiden Markram (14) attempted to pull but only managed to sky for a simple high catch for the grateful Foakes.
Stokes struck again just before lunch, trapping Rassie van der Dussen (16) lbw and, although the video review backed the umpire's call, the South African, who had pushed well forward, will feel he was unlucky with a tight decision.
Anderson, bowling at the end of the ground named in his honour, was on a hat-trick after lunch, trapping Simon Harmer and Maharaj both leg before.
Broad also picked up his third wicket with Kyle Verreynne (21) edging to Foakes before Rabada restored stability to the innings.
Robinson finally got reward for his efforts, removing Nortje lbw with the first ball after tea and Jack Leash finally got rid of Rabada for 36.
It gave England a long evening session to bat and after their shaky start they have left themselves with the chance to build a significant lead on Friday.
"Jonny and Creepy (Crawley) saw out the day and now we are in a very strong position," said Broad.
"It looked at one stage like South Africa could have picked up five wickets this evening when Rabada and Nortje looked in very good rhythm but we are very happy with that day," he said.