Ruiz’s smash down the third-base line off reliever Daniel Castano (0-1) scored automatic runner Dee Strange-Gordon from third. For Ruiz, the hit capped a performance that also included another double, a single and two walks.
“I wasn’t trying to do too much, just look for my pitch,” Ruiz said. “I found something that I could drive and bring in the run. Thank God I found that pitch and we got the result we wanted.”
Jazz Chisholm Jr.’s sacrifice fly against Washington reliever Tanner Rainey (1-1) with the bases loaded in the ninth tied it at 4. The Nationals unsuccessfully appealed that Jesús Sánchez left third base before Soto caught Chisholm’s shot in right.
Victor Arano worked the 10th for his first save.
Marlins starter Pablo López, who began the day with a major league-best 1.05 ERA, had his shortest outing of the season, working three innings on 82 pitches. López allowed three runs, four hits, walked two and struck out two. The right-hander’s ERA rose to 1.57.
“Today was the least comfortable I’ve felt on the mound so far and it was an odd feeling so I was trying to recreate some stuff instead of trying to simplify,” López said. “I was trying to find something that wasn’t there.”
Chisholm, who didn’t feel well during the game, tied it at 3 with his solo shot against starter Josiah Gray to lead off the fifth. Chisholm drove Gray’s fastball over the wall in center for his seventh homer.
“I’m still feeling pretty bad right now, got the shivers all day and still feeling them now,” Chisholm said. “Earlier today, I was just resting all day and when I got to the field, they asked me if I could still play. I felt like I could just play through it, like I could flip the switch when I needed to do it.”
Gray was lifted after six innings. He allowed three runs, six hits and struck out seven and hit a batter.
“You just go out there and attack the zone and put up zeroes for the team,” Gray said. “More times than not, if I get it to the spot I want to, it’s going to be a good pitch.”
Consecutive RBI doubles from Alcides Escobar and Hernández in the second put Washington ahead 3-1 before the Marlins narrowed the deficit on Garrett Cooper’s sacrifice fly in the third.
The Nationals struck quickly against López. Hernández hit a leadoff triple and scored on a wild pitch.
“We had a game plan against Pablo, he’s a tremendous pitcher,” Nationals manager Dave Martinez said. “We wanted to see him throw the ball up and stay away from his changeup. We did a good job with that.”
Miami responded in the bottom half as leadoff hitter Chisholm also tripled and raced home on Jesús Aguilar’s sacrifice fly.
Hernández set the tone early with his nine-pitch at bat in the first. The Nationals made López quickly build up his pitch count, resulting in his brief outing. After Hernández, the four other batters in the inning drew at least five pitches.
“That was awesome,” Martinez said of Hernández’s at bat. “He doesn’t get enough credit because he’s not your typical leadoff hitter but the guy swings the bat. He’s swinging the bat well.”
Marlins: OF Jorge Soler (back stiffness) missed his second consecutive game.
Nationals: RHP Erick Fedde (2-2, 4.24) is the scheduled starter in the opener of a three-game set at Milwaukee Friday.
Marlins: LHP Trevor Rogers (2-4, 4.45) will start the opener of a home series against Atlanta Friday.
Fantasy baseball pitcher rankings, lineup advice for Wednesday's MLB games
Everything you need to know to place your MLB bets and set your fantasy baseball lineups for Wednesday, July 6.
Fantasy baseball forecaster: Team hitting ratings
Stay ahead of the game and optimize your fantasy baseball hitters with our forecaster, which provides a rolling 10-day outlook of every team's hitting matchups as well as the potential for stolen bases.
Fantasy baseball forecaster: Pitcher projections for the next 10 days
Keep up to date on who is pitching -- and how well they're expected to do -- with our forecaster, which provides a rolling 10-day outlook of every team's probable starting pitchers with game score projections.
'It's a dying breed. And it sucks': The decline of the starting pitcher -- and what it means for baseball's future
Starters have never thrown harder -- or less. Here's why finding a solution to its ace problem is crucial for MLB.
Cardinals aim to end 3-game road skid, play the Braves
St. Louis Cardinals (44-39, second in the NL Central) vs. Atlanta Braves (48-34, second in the NL East)
Giants head into matchup against the Diamondbacks on losing streak
San Francisco Giants (40-39, third in the NL West) vs. Arizona Diamondbacks (37-44, fourth in the NL West)