KANSAS CITY, Mo. -- For the second straight night the Kansas City Royals dug out of an early pit to find a way to win.
Lorenzo Cain and Jeff Francoeur each drove in two runs, and the Royals rallied from a five-run deficit to outslug the Tampa Bay Rays 9-8 Wednesday night.
Matt Joyce, Ben Zobrist and Luke Scott hit home runs for the Rays, who have homered in a club-record 16 consecutive games, but it was not enough.
Cain knocked in the go-ahead run in the Royals' five-run sixth. Francoeur's two-out single gave the Royals a 9-6 lead.
The Royals trailed 6-1 going into the bottom of the fourth.
"We just can't keep doing this," Rays manager Joe Maddon said. "We've given up way too many leads this year. We actually did a lot of things well, another good offensive night. We scored runs to win the game, two games. For the pitching to come apart is really unusual for us. Overall, we have to do a lot of things better, but we have to maintain leads. We normally do.
"There's a pretty revealing statistic that in 10 of our 15 losses we've had the lead and given them up. We just can't do that. That particular hit (Cain's single to shallow left-center) was pretty severe and the bouncer up the middle by Francoeur. There's not a whole lot you can do about that. You can't say the pitching was bad there. What are you going to do, just two well-placed hits."
The Rays got two runs back in the seventh with James Loney and Scott stroking RBI singles off Tim Collins, the third of five Kansas City pitchers.
Royals reliever Bruce Chen (2-0) working two scoreless innings after starter Luis Mendoza parted. Mendoza threw four innings and yielded six runs on seven hits, including the three home runs.
"Bruce gave us a very effective two innings after two days of rest," Royals manager Ned Yost said. "With the weather the way it is and the way it's supposed to be tomorrow, we were saying we had to stop this now and Bruce did."
Rays reliever Jake McGee (0-2) allowed five runs on four hits in two-thirds of an innings.
Billy Butler went 3-for-4 for the Royals, who logged 15 hits with every player getting at least one hit.
"The bullpen was big, especially tonight, down 5-0 and 6-1," Butler said. "It was really tough. After the home run (Scott in the fourth) and Bruce came in and we were behind the eight ball there. We stayed within ourselves and keep plugging."
The Rays wasted no time breaking the franchise record for homers in consecutive games. Joyce, as he did Tuesday night, homered in the first inning into the Rays bullpen. Three Mendoza pitches later, Zobrist homered to right, the first time this season Tampa Bay has hit back-to-back homers.
Scott, who was activated off the disabled list Tuesday after missing the first 25 games with a right calf strain, joined the homer parade by leading off the fourth with a homer.
Kelly Johnson's double to right in the second scored Scott, who had singled. Desmond Jennings' sacrifice fly scored Jose Lobaton with the other run of the inning.
Evan Longoria tripled in the third when Royals left fielder Alex Gordon failed to make a diving catch of his line drive and the ball rolled to the fence. Loney singled home Longoria.
Former Rays infielder Elliot Johnson homered to lead off the Royals' third, his first of the season.
Gordon singled home Francoeur, who was hit by a pitch and went to second on a Salvador Perez single, in the Royals' fourth.
The Royals cut the lead to 6-4 in the fifth, when Butler led off with a double, his third hit. Cain tripled him home and scored on Mike Moustakas' sacrifice fly.
"Offensively, our goal is to get the first one or two guys on base every inning," Francoeur said. "Eventually we'll get that hit and we'll get the runs across."
NOTES: Ervin Santana, who starts Thursday, has a 6.2 strikeout-to-walk ratio, which ranked third in Royals history for April. ... Matt Moore, who starts Friday for the Rays at Colorado, leads the majors with a .121 opponent's batting average. He is only the sixth pitcher in big league history to go 5-0 in April before turning 24. The others were Babe Ruth in 1917, Fernando Valenzuela in 1981, Greg Swindell in 1988, Dwight Gooden in 1988, and Dontrelle Willis in 2005. ... The Rays went 12-14 in April, their first losing April since going 9-14 in 2009. The Royals went 14-10 in April after going 6-15 in April 2012.