Nix, recently claimed by the Indians off waivers, homered for the sixth time in his last seven games and Carmona held the Rays lineup at bay for Cleveland to beat Tampa Bay 9-3.
"Stuff like this happens sometimes," Nix said. "It's a funny game. It's just one of those things I can't really explain."
Carmona (8-7) allowed two runs and five hits in 6 2/3 innings for the Indians, who lost their last six at Tampa Bay. Shelley Duncan had a seventh-inning solo shot.
"Another quality start by Fausto," Cleveland manager Manny Acta said. "He deserves all the credit. Contained such a good lineup. Fausto was the key because he was able to allow us to stay in the game until we were able to hit home runs."
Over the last 13 games, 29 of the 56 runs scored by the Indians have come on home runs.
Shields gave up four runs and six hits in 6 1/3 innings. The right-hander is 0-5 in six starts at home since beating the Oakland Athletics on April 28.
"He's a good pitcher," Nix said. "Just got a couple pitches that I've able to put the barrel on."
Nix has two homers in four at-bats overall against Shields, who is 0-4 in six career starts against the Indians.
"We just got out-pitched," Shields said.
Nix hit a grand slam against Shields while with the Chicago White Sox on May 30, which was his only homer before the current hot streak. Cleveland claimed Nix off waivers from Chicago on June 24.
Matt LaPorta had an RBI single during a two-run second that put the Indians up 2-0. Peralta advanced from second to third on a balk and then scored on Shields' wild pitch.
Austin Kearns hit a run-scoring double in the ninth.
Carlos Pena singled in the third to cut the Indians' lead to 2-1 and added a ninth-inning solo homer.
Matt Joyce drew a bases-loaded walk from Indians reliever Chris Perez -- who walked three in a row before ending the inning by striking out John Jaso -- in the seventh as the Rays cut the deficit to 4-2.
"We had plenty of opportunities to score a lot of runs," Tampa Bay manager Joe Maddon said.
They Rays went 1-for-8 with runners in scoring position and left 11 runners on base.
The Rays are 7-2 in July after going 11-14 during June. ... LaPorta (head bruise and sore neck) was back in the lineup after missing the previous three games and finished with three hits. "Great to see," Acta said. LaPorta was accidentally elbowed in the head by Texas Rangers shortstop Elvis Andrus on Monday. ... Tampa Bay left fielder Carl Crawford stole second in the seventh and has 30 steals this season. ... Cleveland shortstop Asdrubal Cabrera (broken left forearm) rejoined the team and resumed batting practice. The infielder could start a minor league rehab assignment early next week. ... Armando Camacaro has joined the Indians as an assistant to the major league coaching staff. ... Tampa Bay signed shortstop Ryan Brett, taken in the third round of this year's amateur draft.