Harold Ramirez led off the decisive frame with a first-pitch single to left and moved up on Randy Arozarena's deep fly to center. One batter later, Raley delivered a two-out RBI hit to right against reliever Carlos Hernandez (0-5), breaking a 2-2 tie.
Raley had four hits in the doubleheader, driving in three runs.
The Rays scored in each of the last three innings, with Ramirez delivering a ninth-inning sacrifice fly to cap the scoring
Colin Poche (7-2) earned the win with a hitless seventh inning and Pete Fairbanks allowed only a leadoff single in the ninth to earn his 10th save.
In his Royals debut after being acquired June 30 as part of a trade for Aroldis Chapman, Cole Ragans pitched through traffic in the first three innings, allowing six baserunners, but held the Rays to a single run
Arozarena got Tampa Bay on the scoreboard first with a two-out RBI single in the third, his second of three hits in the game.
Ragans retired the next seven batters to complete five innings in his first start of the season, allowing four hits and two walks, striking out three.
Kansas City tied the game in the third on Maikel Garcia's sacrifice fly, scoring Nick Pratto, who led off the frame with a double against reliever Cooper Criswell.
The Royals grabbed a 2-1 lead in the fifth on Dairon Blanco's RBI grounder
The Rays tied the game in the top of the seventh on pinch-hitter Josh Lowe's RBI triple
Shawn Armstrong pitched two scoreless innings as the Rays' opener, striking out two
The doubleheader sweep was Tampa Bay's first since taking two in Toronto last July.
The Rays have won three straight and will go for a series sweep Sunday afternoon
Kansas City has dropped eight of nine games and lost 13 of its last 15 series, with one split.
--Field Level Media