Updated

Mike Aviles' solo homer over the Green Monster 3, in the second test of a key four-game series.

David Ortiz knocked in two runs for the Red Sox, who hold a four-game lead over the Rays in the wild card race. Boston trails the Yankees by 3 1/2 games for first place in the AL East.

Josh Beckett (13-5), making his first start since September 5th due to an ankle injury, gave up three runs -- two earned -- on seven hits over six innings. He struck out seven and walked one while improving to 9-4 lifetime against Tampa Bay.

Evan Longoria hit a homer and drove in three runs for the Rays, who failed to build off a 9-2 victory in the opener of this series on Thursday.

James Shields (15-11) allowed four runs on seven hits over seven-plus innings to take the loss, his first since August 16th. He struck out four and walked three.

"The guys got me a couple of runs early and I gave it up in the first inning," Shields said. "My off-speed pitches weren't doing too well."

The Rays pushed across two runs in the first inning. Desmond Jennings led off with a bunt single and moved to second on Beckett's throwing error. With one out, Longoria just cleared the Green Monster for a 2-0 lead.

Boston promptly responded with two runs of its own in the home first. Jacoby Ellsbury led off with a double and crossed the plate on Dustin Pedroia's single to left. Pedroia moved to second on a wild pitch and scored on Ortiz's one-out single off the Green Monster.

Tampa Bay took the lead back in the third. Jennings singled, stole second and scored on Longoria's base hit to right.

The Red Sox tied the game in the home half. Pedroia led off with a single, stole second and crossed the plate on Ortiz's double to right-center field to make it 3-3.

Aviles put Boston ahead in the fourth. With two outs, Aviles crushed Shields' offering over the Green Monster for a 4-3 edge. The ball put a hole in the Sports Authority sign.

"I was looking for a pitch I could drive into the gap, and fortunately I got a hanging changeup," Aviles said.

Alfredo Aceves and Daniel Bard tossed a scoreless seventh and eighth, respectively, for the Red Sox. Jonathan Papelbon struck out the side in the ninth for his 30th save of the season.

Game Notes

The Rays had won six in a row against the Red Sox...Tampa Bay manager Joe Maddon was ejected in the sixth inning for arguing balls and strikes...Shields fell to 7-12 lifetime versus the Red Sox...Beckett has won his last four decisions. He's 6-0 in his last nine outings against Tampa Bay at Fenway...Boston third baseman Kevin Youkilis missed the game due to discomfort from bursitis and a sports hernia. He will also miss Saturday's contest...Tampa Bay went 2-for-13 with runners in scoring position and stranded nine.