BOSTON -- The recently silent offense was driving everyone around the Red Sox a little batty, from the manager's office to the dugout to that rather large collection of ravenous fans that follow the team.

But the defending World Series champions consistently put barrel to bat on Sunday night against the Yankees, salvaging the final game of the three-game series with a 9-2 victory.

The barrage came just in time, as the Red Sox were able to avoid being swept at home for the first time this season.

Of course, this wasn't just a hitting story. One of the stories of the season has been Jon Lester, and the lefty came up big again, scattering nine hits and just two runs over seven innings to improve to 9-3 on the season. Lester walked one and struck out eight.

"We had an important game," said Red Sox third baseman Mike Lowell. "Obviously, we don't want to get swept. I thought the offense was very consistent, and Jonny pitched a great game. He's done that for us all year."

The familiar slugging combo of David Ortiz and Manny Ramirez produced its first big joint effort in weeks. Ortiz, playing in his third game since coming off the disabled list, went 2-for-4, including a two-run homer. Ramirez, who had been the subject of controversy all weekend, smashed three hits, scored twice, drove in two runs and made a fine running catch in left field.

"When those two right in the middle swing it, that's part of what's been successful for us," said Red Sox manager Terry Francona. "David looked like he felt good at the plate, and that's a good feeling for us. Manny swung the bat great. That's what we need. That shouldn't be a surprise. That part of it -- that's why we wanted him out there."

Before the game, Ramirez was a newsmaker once again, saying that he would waive his no-trade rights if the Red Sox were able to deal him before Thursday's 4 p.m. ET Trade Deadline.

"Whatever," said Lowell. "We'll cross that bridge when we get there. Manny says a lot of things. Some of them are entertaining, some of them make you roll your eyes and spin your head. It seems like every time he says something, he goes 3-for-4, so maybe we should encourage him to say something like that."

Jacoby Ellsbury, moved from first to ninth in the batting order, contributed three hits to the cause.

"The biggest thing is practically everybody's healthy in the lineup," said Ellsbury. "That's the biggest thing. When we have everyone healthy and in the lineup, everything is clicking and everything's rolling."

Entering the game, the Red Sox had hit .185 in the first two games of the series and had a .229 average in their first eight games after the All-Star break. But Yankees right-hander Sidney Ponson (four innings, 10 hits, seven runs) proved to be the perfect cure for all that had ailed Boston.

"We swung the bats well, we swung early and stayed consistent," said Francona. "In every inning, we gave ourselves a chance."

Lester didn't give very many to the Yankees. His only spot of trouble came in the fifth. But after allowing two runs, he worked out of a bases-loaded, nobody-out situation and was untouched the rest of the night.

The big out was the first one -- a liner to third off the bat of Alex Rodriguez. Lester then got Xavier Nady on a shallow flyout to center and Robinson Cano on a grounder back to the box.

"After that A-Rod out, I was just one pitch away," said Lester. "It was a tough inning. They battled. That's what the Yankees do."

What Lester does is work like a stopper. In nine starts following a Boston loss, the young lefty is 5-1 with a 1.28 ERA.

"He's still developing, too," said Red Sox catcher Jason Varitek. "At the beginning of the year, everyone was ready to get him out of here. I was like, 'Hold on, wait a minute, let's slow down.' He's working his way. He's learning. He's learning himself, more importantly. As he's learning himself, he's developed, hopefully, a tremendous amount of confidence. He's able to manipulate the baseball a lot differently than he was able to a year ago."

With the win, the Red Sox sliced the Rays' lead to one game in the American League East and pushed their edge over the third-place Yankees back to two games.

The offense came to life immediately in this one. With runners at the corners and one out, Ramirez hammered an RBI double to the gap in right-center. Lowell followed with a two-run single up the middle, and Lester took a 3-0 lead with him to the mound in the second.

Ellsbury, who was hitting ninth for the first time all season, belted a double to left with one out in the second, setting up runners at second and third. Dustin Pedroia capitalized with a sacrifice fly.

Varitek came up with the big hit in the third, ripping an RBI double to left to give the Sox a 5-0 lead.

By the bottom of the fourth, the game started evolving into a rout. Ortiz unloaded for a two-run homer to right, making it 7-0.

"We're getting there," said Varitek. "We still have time to get David more at-bats and keep that tandem working. We had some good at-bats."