Lester (8-6) allowed four hits through eight innings, but Bannister (6-7) gave up just one hit through seven.
Then Mark Kotsay, playing with a calf injury, led off the bottom of the eighth with a clean single to center. Aaron Bates, called up to the majors for the first time on Monday, pinch ran and took second on Nick Green's sacrifice bunt.
Bannister threw a wild pitch in the dirt and Bates moved to third. Pedroia, coming off consecutive three-hit games, hit his first ball out of the infield on Friday for a double off the left-field wall to break the tie.
Bannister intentionally walked Kevin Youkilis before John Bale came on and retired David Ortiz on a groundout.
Jonathan Papelbon got the last three outs for his 23rd save in 25 opportunities.
Lester walked two and had eight strikeouts. Bannister went 7 2-3 innings, giving up three hits and four walks while striking out seven.
Both starters entered the game on a roll.
Lester was 4-1 in his previous seven starts with a 1.74 ERA. The last time he faced the Royals, he pitched a no-hitter May 19, 2008, at Fenway Park. In his previous game against them, he gave up one hit in eight scoreless innings on July 18, 2006.
Bannister had a 2.48 ERA in his last six starts but just a 2-3 record.
On Friday, he held the Red Sox hitless through four innings, allowing only walks to Youkilis in the first and J.D. Drew in the third.
But Jacoby Ellsbury led off the fifth with a single and got his 38th stolen base before Jason Varitek walked. Varitek was out at second and Ellsbury took third on Kotsay's force-play grounder.
With Green up, Kotsay took off for second and was caught in a rundown. Ellsbury raced home and appeared to slide in before catcher Miguel Olivo could tag him. After being called out Ellsbury bounced his helmet hard and was ejected by plate umpire Derryl Cousins.
But Rocco Baldelli, his replacement in center field came up with a big play in the seventh.