Updated

Cody Ross drove in the go-ahead run in the bottom of the eighth inning, Andrew Bailey pitched out of a bases-loaded jam in the ninth and the Boston Red Sox avoided a sweep with a 2-1 win over the visiting Baltimore Orioles on Sunday.

Dustin Pedroia and Ross hit consecutive doubles off Luis Ayala (5-5) to begin the eighth.

"(Pedroia) got a big double to leadoff the inning and Cody, who has driven in runs all year, drove in the second run for us to squeeze by. They're good players," Red Sox manager Bobby Valentine said.

After Junichi Tazawa (1-1) retired the Orioles in order, Bailey was called to record the final three outs. Mark Reynolds hit a one-out single and pinch- hitter Jim Thome followed with a ground-rule double. Chris Davis was then intentionally walked to load the bases for Manny Machado, who grounded into a force out at the plate. Bailey preserved the win and notched his sixth save by striking out pinch-hitter Ryan Flaherty.

Baltimore remains one game behind the AL East-leading Yankees. Oakland beat New York to move within one game of the Orioles for the top wild card spot.

Felix Doubront gave up one run on four hits with a career-high 11 strikeouts in seven innings for Boston, which halted a four-game slide.

Chris Tillman allowed a run and six hits over six innings for the Orioles, who had their win streak snapped at a season-high six games.

"He gave us a really good chance," Orioles manager Buck Showalter said about Tillman. "If we did a couple of thing defensively, he would have probably pitched seven or eight (innings)."

The Red Sox grabbed a 1-0 lead in the fourth inning. With two runners aboard and one away, Danny Valencia hit a ground ball to short. J.J. Hardy fielded and fired to second base for the second out. Robert Andino looked to complete the double play, but made a poor throw to first. The error enabled Ross, who had led off with a single, to score.

Baltimore was held without a hit through the first four innings, but strung three together to begin the fifth. Lew Ford singled and Davis doubled before Machado's blooper brought home Ford with the tying run.

Game Notes

Baltimore's Dylan Bundy made his MLB debut, recording the final two outs in the eighth ... The Orioles lost for only the second time in nine games at Fenway Park this season ... Boston was 1-for-13 with runners in scoring position.