ST. PETERSBURG -- Instead of taking sole possession of first place in the American League East for the first time in 60 days, the Red Sox again received another hands-on demonstration from the Rays of why that quest has been so difficult.

Just as they were last week in Boston, the Rays were resilient. This time, they walked off with a 2-1 win on Dioner Navarro's walk-off single to deep center in the bottom of the ninth.

The winning rally -- a most annoying one from the Red Sox's perspective when you consider the fluky way it unfolded -- was staged off rookie Justin Masterson.

"It was interesting," said Masterson. "Most of all, I was just disappointed we didn't get through it, because Josh [Beckett] pitched such a great game. Of course, you want to keep it tied so that we can score a run."

Consider how it started. Jason Bartlett led off the bottom of the ninth by literally fisting a soft single into short right field over the head of first baseman Kevin Youkilis.

Then came Carlos Pena, who swung and missed at a 1-1 pitch, only to have the strike taken away because an errant toss from the Boston bullpen forced third-base umpire Jerry Meals to call timeout, which neither Pena or Masterson saw.

Naturally, Pena wound up working the count full before drawing a walk.

"I was hoping they didn't [call time] after they missed," said Red Sox manager Terry Francona. "That's one of those, if he hits it, you want time, if he doesn't, you don't."

Masterson struck out Evan Longoria. But he really put himself into a hole by hitting Cliff Floyd on an 0-2 pitch to load the bases. Of all the pitches that haunted the Red Sox, the ill-fated slider that hit Floyd's leg was likely the most damaging.

"It was unfortunate," said Masterson. "That just kind of goes to one of those things where I was trying to get a slider in. I felt like that would have been a good pitch, and it just took off and hit him on the leg. It was not what I wanted in that situation."

That's because the margin for error was reduced to zero. The only thing Masterson could do was induce Navarro into a double play, a popup or a strikeout. Obviously, the first of those options was the best ticket to an escape. So the righty sinkerballer went to his bread and butter, but he left the pitch higher than he wanted to.

Navarro crushed the ball to the warning track and center fielder Coco Crisp -- playing shallow -- didn't have a chance on. And even if Crisp had caught the ball, the game still would have ended on a sacrifice fly.

"A lot of things happened that inning that led to the run," Francona said. "He even got to Navarro and made real good pitches and then he left the last pitch up."

But with the rubber match on Wednesday, the Red Sox again have the opportunity to tie the division in the last of 18 meetings between the teams. A win for the Red Sox would also even the season series, meaning that record within the AL East would wind up as the deciding factor for which club wins the division if the teams finish in a tie.

If there was a silver lining for the Red Sox, it was easily the performance of Beckett. In his third start back from the disabled list, the righty turned in a brilliant outing (eight innings, three hits, one run, one walk and seven strikeouts).

"I'm getting there," said Beckett. "Arm strength and everything like that is getting back."

There was only one pitch Beckett wishes he could have back -- the curveball to Pena that the slugging first baseman belted over the wall in left for an opposite-field homer that tied the game at 1 to open the seventh.

"It's amazing how one pitch can change the complexion of the game," said Beckett. "It's just a poorly executed pitch. I was trying to throw it down and it was up."

The real problem was that the slight misfire came against Pena, and not against just about any other hitter.

"He's a strong son of a [gun]," Beckett said. "You leave a ball up like that, he doesn't even have to hit it good. I didn't think he hit that ball that good. Ninety-eight percent of the guys in the big leagues fly out to left field on that, but he's strong. You can't leave a pitch up to him like that."

How good was Beckett early? He was perfect with one out in the fifth. But Floyd broke up the no-hitter and the perfect game with a hard single to right.

The Red Sox weren't getting much accomplished against Andy Sonnanstine either. Over the first five innings, Boston had two hits and two walks and hadn't advanced a runner past first base.

But in the sixth, the Sox produced at least a semblance of a rally. Jacoby Ellsbury led off with an infield hit and Dustin Pedroia followed with a grounder to third that Longoria mishandled on the backhand. The error put runners on first and second with nobody out, and David Ortiz pushed them to second and third with a grounder to first.

Youkilis produced RBI No. 106 on the season, a sacrifice fly to left that broke the scoreless tie.

That was the end of Boston's offense, and it wound up not being enough.