Alcantara was good in his first outing there. Gray was better.
Gray scattered five hits and didn't walk a batter in his best outing of the season. He threw 100 pitches and was an inning short of the second complete game of his career. He pitched eight innings for the second time in four starts.
"He was outstanding tonight," manager Bud Black said. "If we added on a little more Jon was still alive to go back out. I didn't think tonight was the night to push him to 115."
Gray beat Alcantara in a rematch of a pitching duel in Miami on March 31. Alcantara pitched eight shutout innings in a 3-0 win, but was nicked by a long ball on Friday, one of just three hits he allowed over seven solid innings.
This time it was Gray. He went eight shutout innings and would have gone out for the ninth if the Rockies had a bigger lead. Still, he helped his team win two in a row for just the second time since June 29.
"I knew if we put up a couple of more runs in the eighth I'd get the opportunity," Gray said. "Came really close."
McMahon hit a two-run homer in the second inning, his 15th of the season, in support of Gray, who retired 15 batters in a row after Miami led off the second with consecutive singles.
Gray struck out Lewis Brinson with runners on first and second, and then got an inning-ending double play by Bryan Holaday. Gray set down 12 batters on groundouts, starting with Holaday's double play.
He faced another jam in the seventh when Neil Walker tripled off the wall in right-center with one out. Gray got Starlin Castro to fly out to shallow center and Harold Ramirez lined out to first to keep Miami off the board.
"We attacked from the get go," Gray said. "We didn't walk people, we stayed in the zone with all of our pitches. We just attacked and good things happened."
Alcantara (4-11) went seven innings and allowed just three hits. He walked four, including one ahead of McMahon's homer, and struck out just two. He retired the last seven batters he faced.
"I kept the ball down and got out of trouble with double plays," Alcantara said. "I just missed one pitch in the second inning and it was 2-0."
Arenado homered in the eighth, his 28th. Scott Oberg got the final three outs for his fifth save.
The game was delayed 20 minutes in the third inning due to lightning.
Marlins: RHP Jose Urena (lower back soreness) was scheduled to make a rehab start for Class A Jupiter on Friday night, while RHP Pablo Lopez (right shoulder strain) was slated to throw an inning for Triple-A New Orleans. Both have been out since mid-June.
The Marlins activated Walker from the 10-day injured list before the game and designated infielder Deven Marrero for assignment. Walker missed 12 games with a right index finger sprain.
"It's good to get Walk back, gives us a lefty, a switch-hitter and a guy who can play both corners," manager Don Mattingly said. "It just helps our lineup, lets us stretch it different ways."
Alcantara kept the Rockies off balance for most of the game, but consecutive sliders to McMahon in the second inning proved costly.
"First pitch (was) a backdoor slider that didn't really break back," McMahon said. "The next pitch was a slider over the plate, and he showed me the timing on the pitch before that. I was geared up for a heater but saw it really well. It stayed there and didn't bite like a slider usually does."
Miami will send RHP Hector Noesi (0-2, 8.18) against Colorado RHP German Marquez (11-5, 4.57) in the second game of the weekend series on Saturday night. Noesi has never faced the Rockies, while Marquez is 1/3 in four career starts against the Marlins.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Meadows homers in 11th, Rays rally past Dodgers 8-7
Austin Meadows homered leading off the 11th inning, sending Tampa Bay to an 8-7 victory over the Los Angeles Dodgers that helped the Rays keep pace in the AL wild-card race and prevented the New York Yankees from clinching the AL East title Wednesday...
Bellinger smashes 45th homer of the season
Cody Bellinger gives the Dodgers a 6-4 lead over the Rays with a solo home run to right.
Iglesias' double in 10th leads Reds past Cubs 3-2
Jose Iglesias had an RBI double in the 10th inning and five Cincinnati pitchers combined for a four-hitter as the Reds recorded their second straight win over the playoff-contending Chicago Cubs 3-2 on Wednesday night.
Grichuk slam negates Buchholz dud as Jays beat Orioles 11-10
Randal Grichuk hit a grand slam with two outs in the ninth inning, and the Toronto Blue Jays rebounded from an ineffective start by Clay Buchholz to rally past the Baltimore Orioles 11-10 on Wednesday night.
Twins lose 3-1 to White Sox, division lead trimmed to 4
Held without a hit until the sixth inning, the Minnesota Twins managed only three in 3-1 loss to the Chicago White Sox that shrunk their AL Central lead Wednesday night.
Santander unloads 418-foot homer to center
Anthony Santander extends the Orioles' lead with a two-run jack.