ST. PETERSBURG -- One out into the bottom of the 14th inning and the score remained tied at 3. The Mariners and Rays had combined to strike out 32 times and Joe Maddon glanced at his scorecard and looked at who was left to finish a game that looked like it might never end.
According to the Rays manager, Jake McGee would have pitched the 15th, Wade Davis the 16th and outfielder Hideki Matsui the 17th.
"But [Matsui] didn't know it," Maddon said.
Fortunately for the Rays -- and Matsui -- Friday night's game did not come to that, as the Rays came away 4-3 winners when Carlos Pena scored from first base on Ben Zobrist's one-out double in the 14th at Tropicana Field.
By winning the 4-hour, 46-minute contest, the Rays moved to 49-45 on the season while winning consecutive games for the first time since beating the Yankees on July 2-3.
"Long game, if you're going to stick around that long, you got to win it sometimes and we did it tonight," Maddon said.
With one out in the bottom of the 14th, Pena singled off Tom Wilhelmsen to bring Zobrist to the plate.
"[Wilhelmsen] throws pretty hard," Zobrist said. "If he threw me an off-speed pitch, I was going to take it early in the count. Just looking for the heater, and thankfully he left one up enough that I could hit it hard. I was able to get the bat head to it and fortunately it was down the line."
Zobrist hit a shot that went between the first-base line and the glove of Mariners first baseman Justin Smoak. Pena continued to chug around the bases as right fielder Ichiro Suzuki fielded the ball and fired toward the infield. The throw to the plate arrived just as Pena slid home. When home-plate Brian Runge signaled safe, the Rays had their fifth walk-off win of the season.
"That ball down the line, I never saw it," Pena said. "I just took off. When you take off my only eyes [belong to] our third-base coach. ... I looked at the third-base coach, he was waving, and I heard the crowd, too. I knew the ball was through. And all I'm thinking is I'm scoring.
"Of course, when I hit third, my gas tank got on empty. And I'm like I need the legs to go the next 70 feet here. ... It might not have been the most graceful run from third to home, but it was effective."
Wilhelmsen, who was the last available Mariners pitcher -- catcher Miguel Olivo was loosening in bullpen and would have taken the mound if needed -- was asked how long he would have pitched if necessary.
"Until we won," Wilhelmsen said. "That's what you play for. You like those games. Those are fun. Not perhaps for the spectators that left early, but that's what the game is about. Competitive battle, grind, grind, grind."
The Rays had chances in the 10th, 11th and 12th innings when they had the potential winning run in scoring position with less than two outs, but each time they came away empty-handed. Hideki Matsui, who took over at DH after Luke Scott experienced mid-back tightness, flew out to end the 10th and struck out to end the 12th.
Meanwhile, the bullpen put forth a stellar effort. Joel Peralta, Fernando Rodney, Kyle Farnsworth, J.P. Howell, Burke Badenhop and McGee combined for 6 1/3 innings without allowing a run.
"Outrageous job all the way around [by the bullpen]," Maddon said. "Fernando was great, 'Farnsy' did his thing, I thought J.P. was really sharp again. Beyond that, [James Shields] was outstanding.
Shields made his 20th start of the season after taking the loss in five of his previous seven decisions. And the first-inning scene appeared to be more of the same when he surrendered a one-out triple to Suzuki, who scored when Casper Wells followed with a double.
Then former Rays catcher John Jaso got hit by a pitch and one out later Shields walked Kyle Seager to load the bases. But Shields escaped any further damage by striking out Smoak to end the inning.
Shields took the mound in the second and proceeded to retire the next 11 batters in order before shortstop Sean Rodriguez booted Dustin Ackley's grounder in the fifth. Shields then retired the next four batters he faced.
B.J. Upton kicked the Rays offense into gear when he homered to left leading off the sixth and Jeff Keppinger singled home another run to give the Rays a 2-1 lead.
Carlos Peguero served up the mood killer when he hammered a 1-2 Shields offering into the right-field stands for a two-run homer. Peguero's first home run of the season gave him three career homers against Shields while putting the Mariners up 3-2.
"I made just one bad pitch tonight and that's about it," Shields said. "I was trying to go with a back-door cutter right there and I left it middle-in and he yanked it. [Peguero] is a pretty good hitter. We did well tonight, though. It was nice to get the win."
The Rays answered in the bottom of the seventh when Desmond Jennings doubled and moved to third on Jose Molina's sacrifice bunt. Upton's two-out infield single drove home Jennings to tie the score.
Shields finished with a no-decision, despite the quality start that saw him allow just three runs in 7 2/3 innings while striking out 10.
"Love the fact we were able to win that kind of game," Maddon said. "That's the kind of game that can possibly propel or catapult you a little bit deeper into the season."
Bill Chastain is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.