HOUSTON -- Down by a run with two outs and the bases loaded in the eighth inning, Tampa Bay Rays manager Joe Maddon wrestled with whether to send up his last remaining position player as a pinch-hitter.
Maddon did it and quickly knew he'd made the right decision.
"If I have a chance to really think about it, it's pretty easy," Maddon said. "When everything is rushing through your head ... there's all these different thoughts. But at the end of the day the one thought that is overriding was, the bases are loaded, two outs, this is your best chance to win the game right there. And that's what I went with."
Joyce didn't think Maddon was going to use him there.
"I didn't have my batting gloves on because I didn't expect to hit for (Sean Rodriguez) because I kind of expected to hit for a pitcher in a later inning," Joyce said. "
B.J. Upton homered for the third straight day and tied a season high with four RBIs for the Rays, who have won four in a row to improve to a season-high 10 games over .500.
Longoria came within a triple of the cycle and had his first multihomer game since 2009 -- one of his homers was initially ruled a single until the call was overturned after a video replay review.
Longoria had eight hits, including three home runs, and 10 RBIs in the series while going without batting gloves for the first time since his rookie season.
With the way he's hitting, he may never put on the gloves again.
"I don't know, I feel pretty good right now," he said. "It's all in the way my swing's feeling and it just so happens that it started happening without the batting gloves. So I'm just going to continue until either my hands go or I've got to change it up again."
Joyce's two-out, two-run double put the Rays ahead 9-8. Casey Kotchman followed with a two-run single.
With all their position players on the bench used, Tampa Bay sent Saturday's starting pitcher, Wade Davis, to bat as a pinch-hitter in the ninth. He got his first career hit on a single to right field to make him the first pitcher in Rays history to get a hit as a pinch-hitter. He was later thrown out at home in a collision that shook up catcher Carlos Corporan.
Longoria then hit a three-run homer with two outs to give the Rays a four-run lead.
"After the fourth inning, I felt like we had already been through nine innings," Houston manager Brad Mills said. "I know it was a long game anyway, but it seemed like the fourth inning almost felt like the ninth."
Tampa Bay used 21 players in the interleague matchup. Maddon enjoys games in National League parks because it gives more players a chance to get involved and he likes the unique challenges of managing them.
"National League games are a blast," he said. "They really challenge you mentally. It's a totally different game than the American (League). There's no comparison mentally to the thoughts that you go through on a nightly basis in a National League game compared to an American League game. Not even close."
Matt Downs hit a two-run homer off Joel Peralta in the eighth inning to get Houston within 11-10. Reliever Adam Russell gave up a single to Clint Barmes before a sacrifice bunt and a double play ended the inning.
"It was a pretty exciting game, and they are fun to play like that when they are close," Barmes said. "In these types of games, you are never out of it. Both sides swung the bat really well. It is just tough coming up on the short end."
Houston reliever Wilton Lopez (1-4) took the loss.
Upton's homer gave the Rays a 3-0 lead in the first. He drove in another run in the third to end the three-game series with seven RBIs.
Longoria's first homer was a two-run shot and came in the sixth. The ball, which bounced off the hands of a fan in the first row of the Crawford Boxes, was originally ruled in play and he was thrown out at second. The call was changed following the replay, and that made the score 7-all.
Rays starter Jeff Niemann, who is from Houston and played at Rice, allowed seven hits and five runs in his second game since coming off the disabled list with a back injury.
Niemann singled on a grounder in the second for his first career hit. He became the first Tampa Bay pitcher to get a hit this season after the staff entered Sunday's game 0 for 19.
Houston starter J.A. Happ yielded nine hits and five runs in five innings.
Houston's Carlos Lee has three triples this season to tie a career-high from 2001 with the White Sox. ... The Rays return home on Monday after playing 30 of their last 47 games on the road. ... Upton had hit just one homer in the previous 30 games before this series.