ST. PETERSBURG, Fla. -- Jon Lester rebounded from the worst outing of his career to help Boston tighten the AL wild-card race.
Lester allowed two hits over seven innings and Victor Martinez homered twice off All-Star David Price, pacing a 3-1 victory over Tampa Bay that also enabled the Red Sox to nudge closer to the Rays and New York Yankees in the AL East standings.
"A big win for us. We just battled, and that's what we've been doing all season long," Lester said after Boston trimmed its deficit in the wild-card race -- as well as the division -- to 4 1/2 games. "If we continue to do that, then that will put us in a good position, hopefully, at the end of the year."
With New York losing 9-4 to the Chicago White Sox, the Rays remained tied with the defending World Series champions for first place. This is as close as the Red Sox have been to the top since July 7, when they also trailed by 4 1/2 games.
"We are the three teams that are fighting for first place and the wild card," Boston's David Ortiz said. "Every game is important from now on."
Lester (14-8) won for the third time in four starts. The All-Star left-hander walked five and uncorked three wild pitches, but also struck out 10 while limiting the Rays to two hits and an unearned run.
Martinez hit two-out solo homers off Price (15-6) in the first and seventh. Ortiz doubled and scored on Jed Lowrie's two-out single to give the Red Sox a 2-0 lead in the fourth.
"With Price, we'll take any runs we can get any time we can," Boston manager Terry Francona said. "He throws a lot of strikes, he's got velocity, he's got angle on his fastball. That's why he's one of the best in the game."
Lester allowed nine runs in two innings of a 16-2 loss to Toronto at Fenway Park last Friday. Despite the wildness that helped the Rays score their only run, he retained control of the game by holding the division co-leaders to singles by Carlos Pena in the fourth and Jason Bartlett in the sixth.
"Once they got baserunnners on, he made some unbelievable pitches," Francona said. "He got some double plays, he got some strikeouts."
Center fielder Darnell McDonald preserved a 2-1 lead, hustling in to field Bartlett's single and throwing out B.J. Upton, who was trying to score the tying run from second base. Bartlett also had Tampa Bay's third hit, a single off reliever Daniel Bard with two outs in the eighth.
Upton didn't get a good jump off second because Bartlett's hit was a line drive and the runner had to make sure it fell in. Nevertheless, he thought he had a good chance to score.
"It could have gone either way," Upton said. "It had to be a perfect throw."
The Rays got plenty of help to score their run, benefiting from an error and two wild pitches bunched around Pena's single.
Lester had thrown one wild pitch in 25 starts before unleashing them on consecutive pitches to allow Bartlett, who had reached on shortstop Marco Scutaro's throwing error, to cross the plate.
Price, who struck out eight and walked none, tied a career high by allowing 10 hits in seven innings. The switch-hitting Martinez has been tough on the young lefty, going 5 for 12 with three homers lifetime.
"He's a good hitter," Price said, shrugging his shoulders. "It's frustrating, but it's part of it. You move on."
Tampa Bay played without All-Star left fielder Carl Crawford, scratched from the lineup because of a stomach virus. ... The Rays signed former Colorado OF Brad Hawpe to a minor league contract. He will be assigned to Class-A Charlotte and could join the major league roster as soon as Tuesday. Tampa Bay manager Joe Maddon said Hawpe primarily will be used as a designated hitter. He was an All-Star last season, but was hitting .255 with seven homers and 37 RBIs in 88 games before the Rockies released him. ... Red Sox 2B Dustin Pedroia said his injured left foot is not healing quickly and might require surgery. He will undergo additional tests when the team returns home in a week. A decision on possible surgery will be made after that. ... Rays right-handed reliever Grant Balfour (intercostal strain) expects to pitch for Class-A Charlotte on Saturday and Monday.