ST. PETERSBURG, Fla. -- Boston could only keep Evan Longoria's bat silent for so long.
Tampa Bay's All-Star slugger struck out four times, yet continued his torrid hitting against the Red Sox with two homers Tuesday night, including a two-run shot off Takashi Saito with two outs in the bottom of the 13th inning to give the Rays a 4-2 victory.
"I really was just trying to extend the inning, get a base hit and get somebody into scoring position," Longoria said. "I've faced Saito before so I kind of knew what he was featuring. He left the ball up in the zone."
Longoria, who has seven homers and 24 RBIs in 11 games against the Red Sox this season, homered in the eighth, tying the score 2-all.
"We've seen him at his best," Boston manager Terry Francona said. "We seem to bring out a lot in him."
The Red Sox bullpen worked out of jams in the eighth, ninth and 10th innings, but couldn't do it again in the 13th. Boston also squandered an opportunity of its own to take the lead when Dustin Pedroia grounded into an inning-ending double play with the bases loaded in the 10th.
Michel Hernandez walked to start the 13th. After a sacrifice bunt and a groundout, Longoria hit his 23rd homer of the season off Saito (2-3) to end the 4 hour, 57-minute game.
Lance Cormier (2-1) gave up one hit in one inning for the win.
"The game was totally exasperating. To have so many opportunities and not get it done was frustrating. ... To not have won this game under those circumstances would have been very difficult," Rays manager Joe Maddon said.
The third-place Rays remained 5 1/2 games behind first-place New York in the AL East. The second-place Red Sox had their four-game winning streak stopped and fell 1 1/2 games off the pace.
"It was a fun game to be part of," Francona said. "I wish it ended differently."
The Red Sox wasted a strong performance by Jon Lester, who allowed one run and three hits and struck out 10 in six-plus innings, holding the AL champions scoreless until the seventh. The left-hander hit Carlos Pena with his final pitch of the night, then watched the Rays trim a 2-0 deficit to one run with two singles off the bullpen.
Jason Bartlett drove in Tampa Bay's first run with an infield single off Bard. Longoria made it 2-2, homering off the reliever on the first pitch of the eighth. The Red Sox then needed a break to get out of the inning without falling behind.
Bard, who hadn't given up an earned over 14 innings of his last 12 outings, walked Ben Zobrist and compounded Boston's trouble when he fielded Willy Aybar's bunt and threw wildly past first base into the right-field corner for an error.
Zobrist and Aybar both circled the bases to score on the play, but were sent back to second and third because the ball rolled under an equipment bag in the Rays' bullpen. Pena walked to load the bases with no outs, but Boston escaped when Bard struck out B.J. Upton and Manny Delcarmen retired pinch-hitters Gabe Gross and Pat Burrell.
Kevin Youkilis hit his 20th homer in the second inning and Pedroia connected for his seventh in the sixth for the Red Sox, who conclude a two-game series here Wednesday night before heading to New York for four games against the Yankees.
Both of Boston's homers came off Matt Garza, who limited the Red Sox to three hits while walking two and striking out six in seven innings.
Boston LF Jason Bay (mildly strained right hamstring) was out of the lineup for the second straight game since leaving Saturday's win over Baltimore because of a cramp in the hamstring. He expects to play Wednesday. ... Crawford swiped second and third in the first inning, hiking his major league-leading total to 51. It's the fifth 50-steal season of his career, most among active players. ... Rays manager Joe Maddon tweaked his batting order, using Bartlett as the leadoff man after the shortstop had three hits, walked once and drove in two runs in Monday's win over Kansas City. Customary leadoff batter Upton was dropped to seventh. The move paid off, with Bartlett going 2-for-4 with two walks.