Jacoby Ellsbury scored the winning run. He singled off Brandon Gomes (0-1), stole second, and went to third when the throw from catcher Jose Lobaton was wide.
Ellsbury scored without a play when Victorino singled to second base and Ben Zobrist had no play from his knees.
Junichi Tazawa, the last of five Red Sox pitchers, was the winner. The Rays were held to six hits and were 0 for 11 with runners in scoring position.
The Rays took a 1-0 lead in the third inning.
Desmond Jennings led off by driving a high fastball off the wall in left field. Jennings made a wide turn around first base and was halfway to second when Daniel Nava fired the ball to second base.
Jennings went back first and the Sox might have had a play on him there. But Dustin Pedroia came off the bag to take the throw, spun to the outfield side, and didn’t see the runner.
The next hitter, Sean Rodriguez, knocked a double to left field. Jennings scored standing as the ball rattled around in the corner.
Rodriguez was 2 of 17 in his career against Sox starter Jon Lester before the double.
With Evan Longoria up, a wild pitch moved Rodriguez to third base. But Lester struck out Longoria swinging at a cutter for the first out. With the infield in, Zobrist hit a low liner to the right side, but first baseman Mike Napoli made a diving stab. Shelley Duncan then grounded to third and Lester had escaped a big inning.
The Sox tied it in the fifth inning when David Ross belted a high, 3-and-2 changeup over everything in left field. It was the second home for Ross in five career at-bats against Rays starter David Price.
The Sox mounted a rally with two outs in the sixth inning against Price. Napoli singled to center as did Middlebrooks, snapping his 0-for-14 skid. Nava had a chance and popped to center.
Lester was done after seven innings and 100 pitches. He allowed one run on five hits with one walk and five strikeouts. He retired 14 of the last 15 batters he faced.
Lester has allowed three earned runs in 19 innings this season while striking out 18.
Price went six innings, giving up one run on four hits with two walks and eight strikeouts. He threw 106 pitches, 69 for strikes. Price has a 2.09 earned run average in eight career starts at Fenway Park.
Lefthander Jake McGee retired the Sox in order in the seventh inning. Andrew Bailey did the same to the Rays in the eighth. Ross helped him out by reaching into the stands to grab a foul pop. It cost a patron a beer, a small price to pay for an out.
Joel Peralta handled the Sox in the eighth inning before Joel Hanrahan came out the Red Sox bullpen for the top of the ninth.
It was the first appearance for the closer since he blew a save against the Orioles on Wednesday, allowing five runs. Hanrahan walked Longoria on four pitches before missing with a fastball to Zobrist. That got pitching coach Juan Nieves out to the mound.
Hanrahan had Zobrist struck out but Ross couldn’t hang onto a foul tip. When Zobrist walked, Sox manager John Farrell relieved Hanrahan with Koji Uehara.
Uehara struck out pinch hitter James Loney looking before getting two popups to end the inning. He pumped his fist and waded into the dugout for a high-five festival.
The Red Sox left two runners stranded in the ninth when Stephen Drew lined to center.Peter Abraham can be reached at firstname.lastname@example.org. Follow him on Twitter @PeteAbe.