ST. PETERSBURG, Fla. (AP) — Andrew Bailey took the blame for costing Clay Buchholz and the Boston Red Sox a victory.

B.J. Upton hit a game-ending, three-run homer off Vicente Padilla, capping Tampa Bay’s six-run ninth inning and lifting the Rays to a sorely needed 7-4 victory over the Red Sox on Thursday night.

Bailey (1-1) gave up four hits and a walk before Padilla came in to face Upton, who drove a 2-1 pitch over the wall in center for his 24th homer. It was the Bailey’s second blown save in seven opportunties since returning from right thumb surgery on Aug. 14.

Bailey has allowed a run in just three of 15 appearances this season.

Buchholz outpitched Tampa Bay ace David Price, tossing seven innings of fourhit ball before handing a 2-0 lead to the Boston bullpen. Mauro Gomez hit a two-out RBI triple in the eighth for the Red Sox, but they couldn’t hold on for the victory.

Tampa Bay salvaged a split of the four-game series and remained 5 1/2 games back in the AL wild-card race. The Rays (80-70), who have 12 games left on their schedule, are 6 1/2 games in back of the AL East-leading New York Yankees.

Burke Badenhop (2-2) recorded one out to get the win.

Jose Iglesias had three hits for Boston, including his first career home run. Ryan Lavarnway and Gomez each had two hits and an RBI.

It was only the third win in the last 10 games for the Rays.

Price allowed three runs and eight hits in 7.1 innings. He struck out seven and walked one while throwing 119 pitches.

Cody Ross’ two-out double in the sixth gave Boston the lead and ended Price’s streak of 29.1 scoreless innings at home. Lavarnway drove in Ross with a single.

Iglesias connected against J.P. Howell in the ninth, sending an 0-2 pitch over the wall in center.

Ben Zobrist drove in the Rays’ first run with an eighthinning sacrifice fly off Junichi Tazawa. It was the Rays’ first run in Price’s last three starts at home.

• Who: Baltimore Orioles at
Boston Red Sox.
• Where: Fenway Park.
• When: 7:10 p.m. tonight.
• Starting pitchers: Baltimore (Miguel Gonzalez 6-4)
vs. Boston (Jon Lester 9-