Updated

Daniel Nava and Scott Podsednik both hit solo home runs while Kelly Shoppach had a two-run homer as the Boston Red Sox edged the Baltimore Orioles, 6-5, in the rubber match of a three-game series.

Daniel Bard (4-5) allowed two runs on five hits and four walks in 5 1/3 innings for Boston, which won for the fourth time in five games.

Alfredo Aceves recorded the last four outs to earn his 11th save of the season.

Jake Arrieta (2-5) gave up four runs on eight hits and three walks through 5 2/3 frames to suffer the loss for the Orioles, who have dropped three of their last four.

"It's just a little frustrating to go out there and have that kind of stuff and just not being able to command it early in the game," Arrieta said. "But we were still in a good position. I was still able to get in the sixth and have a shot to even come out in the seventh."

Nick Johnson homered twice and knocked in three runs in a losing effort.

"Got some good pitches over the middle of the plate and put a good swing on them," Johnson said.

The Orioles took the early lead after loading the bases with one out in the bottom of the first inning on a pair of singles by Xavier Avery and Robert Andino and a walk by Adam Jones.

Chris Davis then lifted a sacrifice fly to shallow center field that scored Avery as he beat out the throw to the plate. Andino and Jones both moved up a bag on the throw, but Wilson Betemit followed with a liner to right to end the inning and keep it a 1-0 game.

Boston answered in the second inning when it also filled the bags with back- to-back singles by Kevin Youkilis and Will Middlebrooks and a walk by Nava.

The Red Sox, though, would also only bring in one run on Podsednik's double- play grounder as Mike Aviles ended the inning two batters later with a groundout to second.

Baltimore quickly regained the lead in the home half of the frame on Johnson's leadoff home run to right-center field, but Boston countered in the third when Dustin Pedroia singled, moved to third on consecutive groundouts by David Ortiz and Adrian Gonzalez and came home on Middlebrooks' double down the third-base line.

Youkilis, who worked a walk prior to Middlebrooks' two-bagger, was thrown out at home on the play to end the inning and keep it a 2-2 game.

After the Orioles left a runner in scoring position in the fourth and fifth innings, Boston took its first lead of the game in the sixth when Nava pulled a two-out solo homer over the right-field wall.

Podsednik then singled to knock Arrieta out of the game and Shoppach greeted reliever Luis Ayala by hammering a ball into the left-field bleachers to give the Red Sox a 5-2 advantage.

The Orioles closed the gap in the bottom of the frame off Andrew Miller when Betemit walked before Johnson's two-run blast to right, but Boston regained some cushion in the eighth inning on Podsednik's solo shot to right-center field.

Podsednik, who appeared in his first major league game in nearly two years on Tuesday, had not homered since September 6, 2010.

"It felt real good," Podsednik said. "I got a pitch up, an off-speed pitch up and I put a pretty good swing on it."

Baltimore placed the tying runs on second and third with no outs off Vicente Padilla in the eighth when Nick Markakis led off the frame with a walk and Jones sent a double into the left-field corner.

Padilla then fanned Davis before Che-Hsuan Lin made a diving grab in shallow right field to rob Betemit of a potential game-tying hit.

Markakis scored on the sacrifice fly, but Aceves took the bump and struck out Johnson to end the inning, stranding the tying run on second.

Aceves returned for the ninth and retired the side in order to finish off the four-out save.

Game Notes

Jones extended his hit streak to a career-high 15 games...It was Johnson's first game with multiple home runs since 2006...With a win, Baltimore would have recorded its fourth straight series win against the Red Sox. The last time the Orioles won four consecutive series against Boston was April 27- August 21, 1960, when they won six straight series between the teams...Bard snapped a streak of four straight starts in which he allowed four or more runs...Baltimore leads the season series, 4-2.