Trailing 4-2 entering the inning, the Rays scored four times to chase Cliff Lee (10-6) and record a win in the first of a three-game set at Tropicana Field.
Carl Crawford beat out a double-play try, allowing B.J. Upton to score to pull the Rays to within a run. Evan Longoria then tied it with a run-scoring single and Pena -- fresh off the disabled list with a sore foot -- followed with the decisive hit.
Lance Cormier (4-3) got the final out in the top of the eighth to record the victory for Tampa Bay, which entered the contest a game behind the first-place New York Yankees in the American League East.
Rafael Soriano picked up his AL-best 34th save with a 1-2-3 ninth.
Elvis Andrus and Bengie Molina each had a pair of hits and an RBI for the Rangers.