Desmond Jennings belted a game-winning 4 win over the Rangers on Wednesday afternoon.
Ian Kinsler hit his second solo homer of the game with one out in the ninth inning to tie the game for Texas at 4-4.
The Rays bounced back from an 8-0 loss on Tuesday night to win two out of three games in the series.
Tampa Bay left-hander David Price pitched six innings and was in line for the win after leaving with a 4-2 lead. But Mike Napoli homered off reliever Joel Peralta in the eighth inning and Kinsler tied the game against Kyle Farnsworth in the ninth.
Jake McGee (2-1) worked around Napoli's leadoff single in the top of the 10th to earn the victory.
It was the 1,000th win in Rays franchise history.
Napoli had four hits for the Rangers, who finished up a 3-3 road trip to Boston and Tampa Bay and are headed home for six games against Oakland and Cleveland.
First-place Texas could see its lead in the AL West cut to 2 1/2 games if the Angels beat the Mariners later Wednesday.
The Rays have won four of their last five and are 4-2 on a nine-game homestand that concludes with three games against Boston starting Friday.
They took a 2-0 lead in the first inning against Rangers starter Derek Holland, who entered the game 7-1 in his last 11 outings and had won his last two starts. Ben Zobrist hit a two-run double that scored Jennings and Evan Longoria.
Tampa Bay pushed its lead to 3-0 in the second inning when B.J. Upton cued a slow grounder that Kinsler charged from second base, but could only muster a sloppy throw past first. Kelly Shoppach scored from second on the play.
Adrian Beltre singled and scored Texas' first run on an error in the fourth inning and Kinsler led off the fifth inning with a homer to pull the Rangers within 3-2.
Brandon Guyer's homer in the sixth gave Price and the Rays a 4-2 lead, and the Rangers pulled Holland after Upton hit a two-out single in the seventh. The left-hander gave up six hits and three walks while striking out nine.
Price failed to pitch at least seven innings for the first time in six starts and failed to earn a decision for the first time in the same span. He allowed eight hits and two walks, fanning five.
"David wasn't on top of everything," said Rays manager Joe Maddon, "but nevertheless he got us the lead."
The Rangers won the season series 5-4...Kinsler has 28 homers, three shy of his career high. Napoli hit his 24th homer of the season and is two short of his personal best...Guyer, a rookie, hit his second homer and Jennings got his ninth.