The victory assured the Red Sox of at least the AL wild-card spot. They held their 2½-game lead in the AL East over New York, which beat Toronto 12-11 in 10 innings.

"We are right where we want to be right now, making the playoffs," Lugo said. "I felt like [Boston DH] David Ortiz going around the bases. It's nice to be able to do something to win and make sure we made the playoffs."

Boston trailed 6-5 when Varitek led off the ninth with an opposite-field homer to left against closer Al Reyes (3-3). Eric Hinske then doubled and scored one out later when Lugo homered against his former team. It was Reyes' fourth blown save in 28 tries.

"A lot of happiness," said Ortiz of the mood in the Red Sox dugout after Varitek homered.

"We've got bigger and better things to go after, which is an American League championship" Papelbon said. "Tonight is kind of a beginning of us getting back on top of things."

After the final out, the Red Sox players held a team scrum near the pitcher's mound, high-fiving and slapping each other on the back. Red Sox manager Terry Francona, who many of the players hugged, and the coaching staff stood in a line in foul terrority to greet the players as they headed for the clubhouse.

There was no need for plastic sheets to cover lockers during a brief, but happy, postgame celebration.

"I think we all feel like we have huge aspirations," Francona said. "But there's not a problem with taking five minutes out, reinforcing what we've accomplished and what we hope to. I get the biggest kick out of just seeing the enjoyment on their faces, especially the way the game ended."

Francona is the first manager to lead the Red Sox into the playofs three times.

"I think in the fashion that we won today, and clinch a playoff spot, it's something worth celebrating," Boston third baseman Mike Lowell said. "We should be happy."

Carlos Pena homered twice for the Devil Rays, including a go-ahead, three-run shot in the seventh. He has 42 home runs and 116 RBIs -- Pena played 18 games with Boston last season.

"Believe me, all of us here, we're hurting," Pena said. "Obviously, we wanted to come out with that win. We have pride."

Pena fell behind 0-2 against reliever Javier Lopez before working the count full. Pena then put the Devil Rays ahead 6-5 with his fourth multihomer game this season and 12th overall.

Matsuzaka gave up five and six hits runs in 6 2/3 innings. He is 1-4 in his last six starts.

Greg Norton had two RBIs for the Devil Rays, who are 4-13 against Boston this season.

J.D. Drew hit an RBI double during a two-run fourth. He hit a two-run homer in the sixth off Andy Sonnanstine for a 5-2 lead.

Drew's double and an RBI single by Varitek in the fourth helped Boston take a 3-0 lead.

Pena hit a solo shot and Norton added an RBI single in the bottom of the fourth. Norton got the Devil Rays within 5-3 on a run-scoring single in the sixth.

Jacoby Ellsbury put the Red Sox ahead 1-0 with an RBI single in the third. He has a hit in 18 of 19 games since being recalled from Triple-A Pawtucket on Sept. 1.

Sonnanstine had gone 4-0 over his previous five starts. He allowed five runs and eight hits in 5 1/3 innings.

Game notes
Boston LF Manny Ramirez (strained left oblique) missed his 23rd consecutive game. He still feels discomfort while running, but took batting practice and played catch. ... Tampa Bay All-Star LF Carl Crawford (strained left groin) was out of the lineup for the fifth consecutive game. ... Red Sox 1B Kevin Youkilis (bruised right wrist) is not expected to play this weekend. ... Ortiz hit a two-out double in the first and later got thrown out trying to steal third. He had been successful on three previous stolen bases attempts this year. ... Iwamura went 1-for-3 with a walk against Matsuzaka, and has six hits in 15 at-bats overall this season in the matchup between Japanese rookies.