James Shields made one mistake Tuesday. The way Tampa Bay plays when the All-Star is on the mound, it was too much to overcome.

Shields yielded a three-run homer to Jacoby Ellsbury in the third inning and the Rays' lineup sputtered again, leading to a 3-1 loss to the Boston Red Sox in the first game of a doubleheader at Fenway Park.

"It was a changeup," the right-hander said. "It was down. It was more middle of the plate than I wanted. I wanted it down and away.

"Ellsbury's been hot all year long. He's a good hitter. You make a mistake and he's going to capitalize on it."

Shields (11-10) dropped to 2-1 with a 2.48 ERA in three August starts. The Rays have scored two runs or less in six of Shields' 10 losses and scored more than three in two of the 10.

"You look at his record, what is it, 11-10?" manager Joe Maddon said. "That's another game like that — that's why his record is so deceptive."

Jon Lester (12-6) struck out eight in seven crisp innings for Boston, allowing one run and three hits.

Shields had one bad inning, yielding two singles and Ellsbury's long drive for his career-high 21st homer of the season. It was the only inning the Red Sox had had any hits as Shields went on to his ninth complete game of the season. That's more than twice any other pitcher in the American League.

Tampa Bay sits next to last in the AL in team batting, and could do nothing after a first-inning run as Lester won the duel of All-Star pitchers in a game that took just 2 hours, 24 minutes.

"Yeah, that's a tough loss. It's a tough loss," said Shields, who retired the last 15 batters he faced and struck out six. "You don't give up a hit in seven different innings, you got to win those games. Today we got outplayed."

Daniel Bard pitched a perfect eighth and Jonathan Papelbon got his 28th save when Dustin Pedroia made a diving grab on B.J. Upton's line drive headed for center field.

Desmond Jennings doubled and scored on Evan Longoria's grounder to third to give Tampa Bay a 1-0 lead in the first.

Lester retired 12 straight batters before Longoria's single to left with one out in the sixth. The hit hardly disrupted Lester, who struck out Ben Zobrist and B.J. Upton to end the inning.

The game was a makeup from a rainout April 13.

NOTES: Former Boston OF Johnny Damon received a mix of cheers and boos when he hit for Elliot Johnson in the eighth, then struck out swinging. ... Boston DH David Ortiz was a late scratch from the lineup because of bursitis in his right heel. ... RHP John Lackey, who is on a six-decision winning streak and is 11-8 despite a 6.13 ERA, faces LHP David Price (10-10, 3.76 ERA) in Wednesday's matinee series finale. ... Entering Tuesday's doubleheader, Lackey was tied with Lester for the staff lead in wins. ... Tuesday's opener was the first game between the two teams since the Red Sox edged the Rays 1-0 in 16 innings on July 17 in Florida. ... The Red Sox, just off a six-game road trip to Minnesota and Seattle, returned home for just the three games with Tampa Bay and then head right out for eight games in Kansas City and Texas.