Updated

A ninth-inning rally couldn't save the Oakland Athletics from extra-inning heartbreak.

The A's absorbed their fifth consecutive loss Saturday when J.D. Drew hit a two-out RBI single in the 14th inning to give the Boston Red Sox a 9-8 victory.

Oakland scored four runs off closer Jonathan Papelbon in the ninth to tie it at 7, then took the lead in the 11th. But its bullpen couldn't preserve an unlikely victory.

"It was a great, great comeback to tie the game in the ninth, then to actually go ahead in extra innings," manager Bob Geren said. "We had the game. We were in pretty good shape."

Drew's winning single came against Guillermo Moscoso (2-1), who was the ninth A's pitcher in the 5-hour, 17-minute game.

"We did a great job. The offense came through — tied it up off one of the best closers in the game," said starter Trevor Cahill, who lasted seven innings.

"We got hits when we had to. Just an all-around good job by them. It's just tough to lose a game like that when everybody's battling so hard and just doesn't have anything to show for it."

Oakland, which entered with the second-fewest runs in the AL, scored four times in a wild ninth against Papelbon after second baseman Dustin Pedroia booted a potential game-ending double-play grounder. Catcher Jason Varitek and Papelbon were ejected by plate umpire Tony Randazzo in the inning.

Mark Ellis hit a leadoff single and Daric Barton walked. After Landon Powell struck out, Pedroia had pinch-hitter Coco Crisp's grounder go through his legs, scoring a run. Pennington's RBI double made it 7-5 and Varitek was ejected while arguing during the hit.

Conor Jackson then tied it with a two-run single.

Papelbon was ejected after throwing the first pitch to the next hitter, Ryan Sweeney, and had to be restrained by manager Terry Francona. He appeared to bump Randazzo before being shoved out of the way by Francona.

Bobby Jenks got out of the inning when he struck out Hideki Matsui with runners on first and third with a pitch in the dirt that bounced away. Jackson would have scored from third on the play, but catcher Jarrod Saltalamacchia fired to first just in time.

The Red Sox opened a 5-2 lead in the sixth inning on RBI hits by Pedroia, Kevin Youkilis and Carl Crawford.

Crawford's two-run double made it 7-3 in the eighth.

The late blowup spoiled another solid start by Josh Beckett, who yielded three runs and four hits in six-plus innings. It was just the third time in 12 starts that he's given up more than two runs.

Cahill, coming off his worst consecutive starts of the season, surrendered five runs and eight hits. The right-hander, who won 18 games last season, is 0-2 with a 5.49 ERA in his last three outings.

Jackson also had a key double in the 11th as Oakland grabbed the lead, but Andrew Bailey couldn't hold it.

"You've got a chance to break a losing streak and get things right," Bailey said. "Just kind of obviously didn't do my job. Really not much to say other than that."

Boston tied it with two outs in the 11th. Saltalamacchia doubled high off the left-field wall and scored on Jacoby Ellsbury's double down the right-field line.

Crawford had four hits and drove in three runs and Adrian Gonzalez hit a solo homer for Boston. Alfredo Aceves (3-1) pitched four innings for the win.

NOTES: Francona said before the game that RHP Clay Buchholz's next start may be moved back few days because the pitcher was worried about how his back felt in Friday's start. ... Red Sox RHP John Lackey is scheduled to start the series finale on Sunday in his return from the 15-day disabled list after being sidelined with strained right elbow. ... The game was originally scheduled for 7:10, but moved to 1:10 so Boston fans could get home in time and watch the Bruins play at Vancouver in Game 2 of the Stanley Cup final. ... Matsui snapped a career-worst 0-for-19 slump with an 11th-inning single.