Matt Joyce became the first Rays player ever to hit two homers and have five hits in the same game, and the Rays had their biggest inning of the season in a 12-7 win in Baltimore Sunday.

Tampa Bay scored seven times in the top of the sixth right after Baltimore had gone ahead on a passed ball by Jose Molina. All but one of the runs came with two outs, with Kevin Kiermaier's one-out solo homer making it 4-4.

The Rays had another season best with five homers, Ben Zobrist and Logan Forsythe getting the others. Neither of Joyce's blasts came during the big inning but he did have the go-ahead single to make it 5-4.

In all the Rays had 11 extra-base hits. The Rays took three of four in the series and head to New York next.

It was 12-4 after Joyce's two-run shot in the seventh. Baltimore did get three back in the ninth with a Ryan Flaherty homer against Cesar Ramos, who couldn't finish the deal, Joel Peralta got the last out with a pair of runners on.

The Rays had an 0-for-18 streak going with runners in scoring position until the Joyce go-ahead double started a stretch of four straight. Evan Longoria was intentionally walked before what might have been the biggest hit of the day, a two-run double for James Loney and 7-4 lead. Brandon Guyer doubled for 8-4 and Forsythe's homer made it 10-4.

Until the sixth it had the look of a day the Rays would lament. Zobrist went 3-for-6 with two doubles, the first opening the scoring in the first inning, but he was thrown out trying to extend it to a triple. Joyce doubled with one out but was stranded. The Rays had five baserunners in the first two innings but just a 1-0 lead.

Joyce's solo homer made it 2-0 in the third, then it was Baltimore's chance to not cash in. With four hits they only scored once, thanks to Nick Hundley being thrown out at home on a Nick Markakis double. Baltimore did take the lead though when Manny Machado hit a two-run homer in the third.

But Zobrist homoered to make it 3-3 in the fifth, and after Jose Molina's egregious passed ball on a two-out, 0-2 pitch put Baltimore ahead the Rays had the big answer.

Cobb did not have his best stuff but still got credit for the win. He lasted five innings, allowing three earned runs on eight hits striking out just three.

Joyce drove in four. Each of the bottom three batters in the order (Forsythe, Molina, Kiermaier) had two hits apiece and Jennings had two runs and two walks.

The Rays finally solved Miguel Gonzalez, who had been 2-0 against them this year. He was pulled in the fifth giving up three runs on eight hits and four walks.