Josh Beckett and five relievers combined to pitch a three-hitter for the Red Sox, who won for the eighth time in nine games, retaining a 1 1/2-game lead over the second-place New York Yankees in the AL East.
Pedroia lined a single to right field off Adam Russell (1-2), driving in Josh Reddick from third base. Reddick drew a leadoff walk, moved to second on a sacrifice bunt and to third on Marco Scutaro's infield hit.
Alfredo Aceves (5-1) pitched three scoreless innings for the win. Jonathan Papelbon worked the bottom of the 16th for his 21st save in 22 opportunities.
It was the longest 1-0 game in the major leagues since the Brewers at Angels on June 8, 2004, went 17 innings, according to STATS LLC. The longest 1-0 game ever was 24 innings between the Mets and Astros in 1968.
Both teams got outstanding performances from their starting pitchers, with Beckett allowing one hit — an infield single — and Tampa Bay's Jeff Niemann limiting the Red Sox's potent lineup to a pair of singles through eight innings.
They both also wasted opportunities to win it long before it ended after five hours, 44 minutes — the longest game by time in Rays franchise history.
Beckett limited the Rays to one hit in a 3-0 complete game shutout at Tropicana Field last month, and the All-Star right-hander was equally tough on them this time.
Reid Brignac's third-inning, infield single was Tampa Bay's lone hit off Beckett on June 15. Evan Longoria's grounder back to the mound bounced off the pitcher's right foot with two outs in the first and was the only blemish on his pitching line Sunday, as he struck out six and retired the last 22 batters he faced.
Niemann was almost as good while working a season-high eight innings, allowing a two-out single to Adrian Gonzalez in the first and Pedroia's single down the left field line leading off the fourth. The 6-foot-9 right-hander walked Reddick with one out in the fifth and Scutaro with two outs in the eighth, fanned a career-high 10 and didn't allow a runner past second base.
Pedroia finished with three of the Red Sox's five hits. The rest of the team was 2-for-45.
Both teams wasted opportunities to win it in the ninth.
The Red Sox loaded the bases on Pedroia's double and two walks before reliever Kyle Farnsworth escaped by getting Reddick to fly to center field. Longoria flied to right, sending the game into extra innings after Boston's Daniel Bard gave up a two-out single to Johnny Damon and walked Ben Zobrist in the bottom of the ninth.
Boston narrowly missed going ahead when Gonzalez lined a pitch toward the left field corner that tailed into foul territory in the 10th, then failed to score after loading the bases with no outs on three walks in the 11th. Jake McGee struck out Reddick, and Cruz fanned Varitek and got Scutaro to foul out to get out of the inning.
Rays manager Joe Maddon and bench coach Dave Martinez were ejected by plate umpire Chad Fairchild during the 11th inning. Maddon was tossed during a pitching change, leaving Martinez to lead the Rays. Martinez was ejected after leaving the dugout to have words with Fairchild after Scutaro slammed his bat to the ground in frustration after popping up.
The bat bounded toward catcher Kelly Shoppach, but did not prevent him from making the catch.
The Red Sox improved to 12-2 since June 30, hiking the best record in the AL to 57-36. The third-place Rays have lost 9 of 15 to fall a season-high seven games off the pace in the division.
Beckett was scratched from the All-Star game in Phoenix last Tuesday night after feeling soreness in his left knee while warming up in the bullpen. The right-hander pitched just five innings in his last start before the break against Baltimore after slightly hyperextending his knee on a wet mound at Fenway Park.
Since spending six weeks on the DL with a lower back strain, Niemann has turned his season around with four strong performances over five starts since his return on June 20 against Milwaukee. In six starts prior to going on the DL, he went 1-4 with a 5.74 ERA.
Notes:
Boston manager Terry Francona said LF Carl Crawford (strained left hamstring) will be in the starting lineup for Monday night's game at Baltimore. He finished a two-game rehab assignment at Triple-A Pawtucket on Saturday. … Tampa Bay RF Matt Joyce was scratched from the starting lineup because of a sore knee. The first-time All-Star was injured when he fouled a ball off his right kneecap during the fifth inning Saturday. He pinch hit in the ninth against Bard and lined out. … Red Sox LHP Jon Lester (strained back muscle) is scheduled to rejoin the rotation a week from Tuesday and pitch against Kansas City. … David Ortiz had no news about his appeal of a four-game suspension stemming from Boston's bench-clearing melee with Baltimore on July 8. The slugger thinks he could get an update Monday.