BOSTON – Justin Masterson doesn’t hold a grudge against the Boston Red Sox for shipping him to Cleveland at the trading deadline last year.

Instead he holds on to the things he learned during his three years in the Boston organization.

“It keeps you locked in the whole time because you know that at any time they can make that comeback,” Masterson said Wednesday night after beating his former team for the second time this season, pitching five strong innings to lead the Indians to a 9-1 victory.

Andy Marte hit a three-run homer in a five-run seventh inning, and Jayson Nix homered off the left-field pole to give Cleveland its fourth win in five games. The Indians took advantage of three Boston errors to score seven unearned runs, including all five in the seventh when they turned a 4-1 game into a 9-1 blowout.

The Indians, who put catcher Carlos Santana and designated hitter Travis Hafner on the disabled list this week, improved to 12-8 since the All-Star break and moved out of last place and into a tie for fourth. Nix was at DH on Wednesday, and Lou Marson went 1 for 4 at catcher.

“A lot of them are happy to be here and see the ballpark and all that,” Manager Manny Acta said. “They’ve got an opportunity to impress us over the next two months.”

Masterson was the winning pitcher for Boston in Game 5 of the 2008 AL Championship Series when the Red Sox staged the biggest postseason rally since 1929, coming from a 7-0 deficit to beat the Tampa Bay Rays. With Cleveland this year, he is 2-0 with a 0.64 ERA against Boston and 2-10 with a 6.06 ERA against everyone else.

Masterson threw a two-hit shutout against the Red Sox on June 9, a game in which no Boston runner reached second base. He wasn’t quite that good Wednesday, but held the Red Sox scoreless long enough for the Indians to take a 4-0 lead.

Making his first start at Fenway Park against the team that developed him, Masterson allowed one run on four hits and four walks, striking out three in five-plus innings.

“Unfortunately (he was) pretty good,” Red Sox Manager Terry Francona said. “We didn’t have much to show for it when it was 4-1 and started to make him work and got him out of there.”

David Ortiz homered for Boston, extending his hitting streak to 13 games, his longest in three years.

Jon Lester (11-7) gave up four runs, two earned, on seven hits and four walks, striking out three in five-plus innings. He has lost four consecutive starts for the first time in his career; he has gotten a total of three runs of support while he was in the game over that span.

Lester allowed one third-inning run and two more in the fifth, when Francona noticed him stretching out a cramp and came out to check on him for the first time. There was another problem in the sixth but Lester stayed in; Nix homered on the next pitch to make it 4-0.

“He was cramping up,” Francona said. “He didn’t look too good (in the sixth). I went out there after the first two pitches. I felt bad leaving the mound. I felt like I gave up the homer.”

Lester said he had a cramp in his left hamstring that may have been an effect of the 86-degree, humid weather.

“You’re not used to pitching in these conditions,” he said. “I’m in a funk right now. Weird things are happening. I’ve just got to keep working. Am I throwing the ball the best I can? No. But I’ve just got to keep grinding it out.”