Updated

Mark Buehrle didn't pitch particularly well and felt even worse.

The Miami Marlins had their biggest offensive outburst in more than two weeks and Buehrle couldn't capitalize on the rare run support in a 7-5 loss to the Boston Red Sox on Tuesday night.

Miami took a 2-0 lead in the top of the first, but Buehrle allowed a two-run homer in the bottom half to tie it. Then, after Miami battled back from a 5-3 deficit to tie it again, the Red Sox got a leadoff double off Buehrle and quickly regained the lead and hung on for the victory.

"We come out and score a bunch of runs today, which we've been struggling to do, and I can't keep us the lead," said Buehrle, who allowed six runs in five innings.

Buehrle (5-8) allowed seven hits, including three homers, while losing his fourth straight start.

Miami hadn't scored five runs since a 5-1 win at Philadelphia on June 3.

"I think I felt like I had stuff working for me," Buehrle said. "Just in key moments, it was either make a good pitch and they hit it or make a mistake and they're making you pay for it. It's obviously frustrating."

David Ortiz hit his 17th homer, a two-run shot to tie it in the first, and Clay Buchholz won his fourth straight start for Boston.

Cody Ross, activated from the disabled list before the game, and Kelly Shoppach also homered as Buchholz (8-2) benefited again from a strong hitting attack. He entered the game with the second-best support in the majors, 7.51 runs per nine innings.

And the win came at Fenway Park, where the Red Sox had lost their previous three games, six of seven, and are just 15-19 this season. The Red Sox won their third straight overall in the opener of a nine-game homestand.

Logan Morrison drove in all five Miami runs with a two-run homer and two doubles, then sent center fielder Ryan Kalish toward the wall where he made the catch with a runner on third and two outs in the seventh inning. The Marlins stranded a runner at second in the eighth.

"We got a few people on base. We couldn't get them in," manager Ozzie Guillen said. "At the end of the game that's going to hurt."

The Marlins dropped to 2-11 in their last 13 games as Buehrle in a rematch of a 2-1 loss to Buchholz in Miami on June 12.

The Red Sox scored six runs in five innings against Buehrle, breaking a 5-5 tie on Adrian Gonzalez's sacrifice fly in the fifth.

Alfredo Aceves worked a perfect ninth for his 17th save in 20 opportunities.

Buchholz was 3-0 with a 1.45 ERA and 28 strikeouts in his previous four starts but struggled against a team that began the day with a .213 road batting average, the worst in the majors.

The Marlins jumped on him in the first with a two-run homer by Morrison, his sixth of the season. But Ortiz tied the game in the bottom of the inning with a two-run shot.

In the second, another two-run homer, Shoppach's fourth of the year, put the Red Sox on top 4-2 before Morrison doubled in a run in the third.

Ross then hit his eighth homer, a solo shot, to give Boston a 5-3 lead in the fourth. It was his first game since recovering from a fractured bone in his left foot. Miami tied it in the fifth on a two-run double by Morrison.

Then the Red Sox went ahead to stay in the fifth when Mike Aviles doubled, took third on Dustin Pedroia's sacrifice and scored on Gonzalez's fly to right. That made it 6-5 and they added a run in the seventh when the first two batters against reliever Chad Gaudin, Kevin Youkilis and Will Middlebrooks, doubled.

NOTES: Boston put OF Scott Podsednik on the 15-day DL with a strained left groin. ... Miami's Ricky Nolasco (6-5) faces Felix Doubront (7-3) in the second game of the three-game series on Wednesday night. ... Guillen said he's been impressed with reliever Steve Cishek, a 2005 graduate of Falmouth H.S. on Cape Cod, who has pitched two scoreless innings against the Red Sox this season. He is 4-0 with a 1.91 ERA in 28.1 innings overall. ... Kalish misplayed two fly balls near the wall in center field. In the fifth inning, he didn't go back enough for Morrison's shot and the ball bounced at the base of the wall for a double. In the seventh, near the same spot, he dropped Jose Reyes fly for a three-base error.