ST. PETERSBURG, Fla. -- Tampa Bay rookie Wil Myers knew the slumping Rays badly needed a victory and he came through with a late big hit.
Myers had a tiebreaking double in the eighth inning and the Rays beat the Boston Red Sox 4-3 on Thursday night to avoid a three-game sweep.
"We needed it bad ... we needed to win bad," Myers said. "With the wild-card getting tight, we needed a win here and we didn't want to get swept by those guys."
Jake McGee (5-3) pitched a scoreless eighth before Fernando Rodney got three outs to earn his 34th save. The Rays lead the crowded race for the second AL wild card despite going 5-13 since Aug. 25. Tampa Bay remained one game ahead of the New York Yankees, who beat Baltimore 6-5 later Thursday night.
"We've got to keep winning," Myers said. "Just not one and lose tomorrow. We need to win this series coming up and keep it going the rest of the year."
The Rays open a three-game series at Minnesota on Friday night before returning home to play four games each against playoff contenders Texas and Baltimore.
"We're going to get real hot at exactly the right time," Tampa Bay manager Joe Maddon said. "A game like this really promotes that emotional lift that we needed right now."
"You try and win every series," Saltalamacchia said. "That's the No. 1 goal, and we lost tonight but we took a good two out of three. So we'll go home against New York and worry about Game 1. And see what happens after that."
Boston will play the Yankees three times this weekend at Fenway Park.
The Red Sox threatened in the ninth when Stephen Drew had an infield single and pinch-hitter Mike Carp walked with one out. Rodney worked out of the jam when pinch-hitter Will Middlebrooks lined out to third and Dustin Pedroia popped out.
Ortiz hit an opposite-field solo homer to left and Drew had a run-scoring double as the Red Sox tied it at 3 in the sixth. Ortiz has 43 career homers against Tampa Bay, the second-most by an opponent. Of those, 28 have come at Tropicana Field.
Longoria tripled and scored on Myers' single to put the Rays ahead 1-0 in the second. James Loney made it 2-0 with an RBI double in the third.
Saltalamacchia snapped an 0-for-21 stretch and pulled Boston to 2-1 on a fourth-inning homer.
Tampa Bay went up 3-1 in the bottom half when Desmond Jennings hit a solo home run.
Rays starter Jeremy Hellickson allowed three runs and four hits in 5 1/3 innings.
Boston manager John Farrell said right-hander Jake Peavy got hit on the right wrist by Jennings' drive in the sixth. The ball was redirected to third baseman Xander Bogaerts, who got a forceout at second.
Peavy gave up three runs, four hits and five walks over six innings.
"The command was a little bit missing obviously, with the number of walks issued," Farrell said. "But his competitiveness, he finds a way to make a pitch in a key moment."
Ortiz has 428 homers, which moved him past Mike Piazza for 46th place all-time. ... The Red Sox will honor Yankees closer Mariano Rivera before his last regular-season game at Fenway Park on Sunday. Rivera is retiring after the season. ... Boston OF Jacoby Ellsbury (foot), who missed his sixth consecutive game and is not yet doing baseball activities, will have his status evaluated in the next few days. ... Rays C Jose Molina left the team to be with his mother, who had surgery. He is expected back Friday. ... Shane Victorino was out of the Red Sox lineup because Farrell wanted to give the outfielder a day off from playing on the artificial turf. ... 2012 Olympic silver medalist and professional beach volleyball star Jen Kessy served a volleyball from the mound for the ceremonial first pitch.
Tatis smiles upon hearing his name attached to LeBron and Mahomes
Fernando Tatis Jr. smiles when he is compared to LeBron James and Patrick Mahomes.
Trout talks with MLBPA chief Clark daily with current CBA expiring soon
Mike Trout says he chats with MLBPA executive director Tony Clark often as the union seeks out advice about CBA negotiations.
Shin-Soo Choo to play for South Korean club on 1-year, $2.4M contract
Shin-Soo Choo will play for a basebal club in his native South Korea after agreeing to a one-year contract worth 2.4 million, the biggest of its kind in the KBO league.
Ohtani: Velocity topped out at 97mph
Shohei Ohtani reacts to throwing live batting practice for the Angels and says his velocity topped out at 97mph.
Fresh off Cy Young season, Shane Bieber would 'love to dive into' contract talks with Cleveland Indians
As the optimistic Indians ponder contract talks with ace and Cy Young Award winner Shane Bieber, team president Chris Antonetti said Cleveland is "hopeful that Shane will be here for a really long time to come."
Throwing live batting practice, an optimistic Shohei Ohtani tops out at 97 mph for Los Angeles Angels
Saying that the "rules are -- there aren't going to be any rules" with Shohei Ohtani's usage this season, Angels manager Joe Maddon is optimistic about the veteran's prospects on the mound.