Updated

On the hottest day of the year in Boston, David Ortiz led the Red Sox to their biggest offensive attack of the season.

Ortiz continued his torrid hitting with a grand slam for one of their four homers as they set a season high in runs, beating the Miami Marlins 15-5 on Wednesday night.

The Red Sox pounded out 16 hits and won their fourth straight game and sixth in their last seven on a night when the game-time temperature was 95 degrees.

"The weather warmed up a little. Guys felt loose," Boston manager Bobby Valentine said.

Ortiz hit his 18th homer of the season, his third in three games and fourth in six, a span in which he is 9 for 20. The grand slam in a six-run fourth inning was the 11th of his career.

"I don't get many opportunities (with pitches) over the plate," he said. "I just try to be patient for that one pitch they give me to hit."

The Red Sox moved out of last place in the AL East at 35-33, passing Toronto after the Blue Jays lost 8-3 to Milwaukee.

Mike Aviles, Jarrod Saltalamacchia and Will Middlebrooks also homered one night after Ortiz hit one of Boston's three homers in a 7-5 victory over Miami.

"Hitting is definitely contagious and so is winning," Aviles said. "Any time you get a couple of wins together you just get that good confidence going and you just keep rolling with it and that's where we're at right now."

The Marlins lost for the 12th time in 14 games despite getting four runs and nine hits in six innings against Felix Doubront (8-3).

Ricky Nolasco (6-6) gave up nine runs and nine hits in 3 1-3 innings.

"I just think we're all trying to get on a positive run right now," he said. "It's just not happening. The last two games we swung the bats well. We just haven't pitched (well)."

The Red Sox offense has come alive in the past week with at least seven runs in four of their last six games.

On Wednesday, Aviles's three-run homer gave Boston a 3-2 lead in the second. In the third, Cody Ross' three-run double, on which Ortiz hustled home where the throw hit him and bounced away from catcher John Buck, made it 6-2.

"Guys are just getting on base left and right," Ross said. "We're coming up with big hits. Red Sox baseball."

Before the game, Miami manager Ozzie Guillen said he wouldn't change his lineup to help stop the slide. His offense has been better, scoring five runs in each game of the series after going 12 straight with four runs or less. But even when the Marlins scored, it wasn't always easy.

Buck hit his fifth homer, a solo shot that made it 13-5 in the seventh, but immediately clutched his right hamstring and trotted slowly around the bases. He remained in the game before leaving for a pinch hitter in the ninth.

For the second straight game, the Marlins led 2-0. They scored in the first on singles by Jose Reyes and Hanley Ramirez and a double-play grounder by Giancarlo Stanton. They added a run in the second on a double by Justin Ruggiano, a single by Omar Infante and a groundout by Gaby Sanchez.

But the Red Sox quickly jumped ahead by four runs after three innings.

"This is the type of game that can get you down and wonder what's going on," Guillen said. "The starting pitchers have not been doing their job of late."

The Marlins cut the lead to 6-4 in the fourth on a solo homer by Logan Morrison, who drove in all five runs on Tuesday, and a run-scoring groundout by Sanchez.

Boston drove Nolasco from the game in the fourth when singles by Aviles, Daniel Nava — who had four — and Ryan Kalish produced one run. After a single by Adrian Gonzalez loaded the bases, Ortiz hit his grand slam off Chris Hatcher. Saltalamacchia's 13th homer finished the inning.

Ortiz came up with the bases loaded again in the fifth, but Hatcher threw a wild pitch that allowed Nick Punto to score Boston's 13th run.

Middlebrooks hit his seventh homer, a two-run shot in the eighth.

NOTES: Boston 2B Dustin Pedroia missed the game as a precaution after feeling discomfort in his right hand on his last at bat in Tuesday night's win. ... Nolasco lost his third consecutive start and fourth in his last five. ... In Thursday night's series finale, Carlos Zambrano (4-5) is set to pitch for Miami against Daisuke Matsuzaka (0-2). ... The Red Sox signed SS Deven Marrero, their first-round pick and 24th overall in the amateur draft. He hit .325 in three seasons at Arizona State. He will be assigned to Single-A Lowell. ... Nava's four hits matched a career high set on June 1. ... Ortiz tied Joe Carter for 52nd place with 396 homers.