Soto added a double and a walk for the Nationals, who took three of four from the Rockies to win their first series at home. Lane Thomas had a two-run homer.
''I've been swinging the bat pretty well the last few days,'' Soto said after going 2 for 3. ''I've been doing my homework, working on my swing, working on my stance and everything. Just feel great.''
Rockies starter Kyle Freeland (1-5) exited with a foot injury with two outs in the sixth inning. He landed awkwardly on his 107th pitch and was helped off the field. Freeland was charged with five runs on seven hits. He walked four and struck out two.
''On push off, just felt a shooting pain at the top of my foot right at the joint kind of going down my foot,'' Freeland said. ''I have no idea what it was. I've never had it before, but it was good that X-rays came back negative. We think it was just a little bit of impingement there, so we'll see how I feel tomorrow.''
Manager Bud Black didn't think Freeland will need to go on the injured list.
After pulling within 6-3 in the seventh, the Rockies got RBI singles from Brendan Rodgers and Sam Hilliard with one out in the eighth against Kyle Finnegan. With runners on first and third, Nationals closer Rainey struck out Elias Diaz and Charlie Blackmon.
''Obviously it's the tying run there (at third). Can't give it up. At least do your best not to,'' Rainey said. ''Knew we needed either a hard ground ball for the double play with the first guy or a strikeout. Ended up getting the strikeout, so that gives you a little more leeway.''
Rainey finished with a 1-2-3 ninth for his fifth save.
Nationals starter Josiah Gray (5-4) worked around three hits and four walks to allow one run over five innings.
Blackmon led off the game with his seventh homer for the Rockies, who finished their road trip 2-5 and are 7-15 away from home this season. Rodgers went 2 for 4 to extend his hitting streak to 16 games, matching his career high.
''The way we came back, got some opposite field hits, put the ball in play, that would have been a nice one,'' Black said.
Soto hadn't homered since May 12 against the Mets. He gave Washington a 2-1 lead when he hit his ninth of the season, a line drive to center in the bottom of the first. He raised his average to .236.
''When he starts hitting the ball out of the ballpark, it's going to come in bunches,'' manager Dave Martinez said before the game.
Thomas hit a two-run homer in the sixth to make it 6-1.
Rockies right-hander Chad Smith, 26, pitched a 1-2-3 seventh inning in his Major League debut, retiring Josh Bell, Maikel Franco and Riley Adams in a 6-3 game.
Nationals DH Nelson Cruz extended his season-high hitting streak to 10 games, going 1 for 4 with a double. During the streak, he is hitting .444 (16 for 36) with five doubles, seven RBIs, and five runs scored. He has raised his average to .238.
Nationals: RHP Stephen Strasburg (thoracic outlet surgery) pitched five scoreless innings Sunday in his second rehab appearance for Class A Fredericksburg. He didn't allow a hit while striking out six and walking one. He threw 58 pitches. Strasburg will travel with the team and throw a bullpen before his next rehab start, which could happen with Triple-A Rochester.
Rockies: RHP Ryan Feltner (0-1, 5.40 ERA) will make third start of the season when Colorado opens a three-game series against the visiting Marlins. He allowed two runs over five innings while striking out seven on May 25 against the Pirates.
Nationals: RHP Erick Fedde (3-3, 3.55 ERA) pitches the opener of a three-game road series against the Mets. Fedde is 0-3 with a 5.04 ERA in 14 career games - nine starts - versus New York.
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2023 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.