MIAMI (AP) -- Sonny Gray changed his clothes, and went right back to work.
Gray pitched into the seventh inning, Freddy Galvis drove in four runs and the Cincinnati Reds beat the Miami Marlins 6-3 on Monday night.
Gray (10-6) walked five, but limited Miami to two runs and four hits. The right-hander improved to 4-0 in August, allowing three runs in five starts.
After a difficult first three innings, Gray went to the clubhouse and switched into a new uniform.
''I changed everything, it was weird,'' Gray said. ''You do some weird things every now and then.
''After the third I just tried to resettle and start over. Who cares what happens. Start this day over. I was in the clubhouse - didn't have any clothes on. From the fourth inning on, I tried to go as long as I could.''
Galvis had three hits and Eugenio Suarez hit his 36th homer for the Reds, who snapped a three-game losing streak.
''It was a tough weekend and it starts today,'' manager David Bell said. ''Just to turn the road trip around and the guys played really well.''
Gray retired 12 consecutive batters after he allowed Neil Walker's two-run homer in the third. He was pulled after he walked Isan Diaz and allowed Jorge Alfaro's broken-bat single in the seventh.
Michael Lorenzen came in and retired Lewis Brinson on a sacrifice bunt, struck out pinch-hitter Curtis Granderson and got Jon Berti to bounce to shortstop.
Lorenzen also pitched a scoreless eighth before Raisel Iglesias worked the ninth. Alfaro hit his 13th homer and Brinson tripled before Iglesias struck out Martin Prado and Berti to end the game.
Galvis' three-run homer off Pablo Lopez erased a 2-1 deficit in the fifth. Galvis' drive sailed over the wall in left-center for his 22nd of the season and fourth since joining the Reds on Aug. 13.
''Big, big moment, big hit in the game,'' Bell said.
Suarez's solo shot off Kyle Keller in the eighth made it 5-2. Keller also allowed a solo homer by Phillip Ervin in the ninth.
Lopez (5-6) made his first start since June 15 after being sidelined by a shoulder strain. The right-hander allowed four runs in five innings.
''It was fun to be out there, feel the environment, be in the dugout and feel part of the game instead of just watching,'' Lopez said.
The Reds took a 1-0 lead in the third when Galvis' fielder's choice drove in Josh VanMeter after he reached on a one-out triple.
REDS STILL CONFIDENT
After getting swept by the last-place Pirates over the weekend, the Reds hope to salvage their 11-game road trip with their four-game set against the Marlins, who have the worst record in the NL. Next up is a four-game series at NL Central-leading St. Louis beginning Friday.
''We're going to fight, scratch and claw until they tell us we can't anymore,'' Lorenzen said. ''It's easy when you have a bunch of guys you enjoy being around to continue to fight. We have too much fun showing up to the field every day. So we're going to continue to scratch and claw our way back in it.''
The Marlins optioned left-hander Jose Quijada to Triple-A New Orleans to make room for Lopez. In his last four relief appearances, Quijada allowed five runs and walked seven.
Marlins: RHP Jose Urena (herniated disk) made a rehab start Monday for Triple-A New Orleans. Miami manager Don Mattingly said he could return next month.
Reds: RHP Luis Castillo (12-5, 3.04 ERA) will attempt to remain unbeaten against the club that traded him to Cincinnati prior to the 2017 season. Castillo is 2-0 with a 0.39 ERA in his three previous starts against Miami.
Marlins: LHP Caleb Smith (8-7, 3.82 ERA) has lost three of his last four decisions.