WASHINGTON — After being thumped by the Yankees in two out of three games, the Red Sox thanked the baseball gods for the Washington Nationals.

The Nationals proved to be an awful opponent, being swept by the Sox in their own ballpark, culminating in their signature 11 a.m. Fourth of July game, 3-0. The Nationals provided the Sox an avenue to feel good about themselves again after the downer series at Yankee Stadium. They departed Nationals Park dressed in patriotic garb for the two-hour flight to Kansas City. Everybody was having a good time.

But when you play teams such as the Nationals, or the Angels, whom the Red Sox beat in all six games this season, it can give a false sense of security. The Nationals are so bad right now that the Red Sox should have swept them. So, it’s hard to gauge. Are they the team that doesn’t quite have enough to win a series over the Yankees in New York? Or are they a team that can beat up most everybody, have a record that is 30 games over .500, but fall short against teams they need to beat?

Let’s be real, the Red Sox need to be able to beat the Astros, Yankees, Mariners, and Indians, against whom they’re 10-10 this season (though they haven’t played the Indians). Yet the Nationals provided the Sox with a feel-good moment.

What we do know is that Eduardo Rodriguez pitched well in sweltering conditions on Wednesday — six shutout innings, three hits, six strikeouts, and just one walk. But the Nationals are making a case for first-year manager Dave Martinez to be fired.

The Nationals were one collective blank stare, and it’s amusing to think that Martinez felt his team exhibited energy in its 4-3 loss to the Sox on Monday. Heck, maybe the best pitcher in baseball, Max Scherzer, allowed a three-run double to the pitcher (Rick Porcello), which pretty much sealed the Nationals’ fate in the series opener and certainly didn’t set a good tone.

Whatever it was, the Red Sox took advantage of the Nationals’ boo-boos.

Take the seventh inning on Wednesday, for instance. Runners at first and third and Jackie Bradley Jr. at bat in a 0-0 game. Bradley hit a fly ball into foul territory, where left fielder Adam Eaton made a sliding catch. Rafael Devers correctly tagged up and scored, and Eaton threw the ball away, allowing Eduardo Nunez to move to third. Reliever Ryan Madson, who was throwing 97 miles per hour, uncorked a wild pitch on ball four to pinch hitter Andrew Benintendi. Nunez scored the second run and the game was pretty much over.

The Nationals lost their starting pitcher in the second inning when Erick Fedde experienced a significant loss of velocity, to the point where trainer Paul Lessard and Martinez had to visit the mound and take him out of the game. The Nationals got lucky that reliever Matt Grace pitched four scoreless innings or this one would have been a laugher.

There were 42,528 on hand, a sellout. They watched Nationals amateur hour. This is a team that has all of baseball wondering what’s going on? The Nationals were overwhelming favorites to win the National League East. They won 97 games last season, fired manager Dusty Baker, and brought in Martinez, a Joe Maddon protégé, thinking he would bring Maddon Magic to Washington. It’s been anything but.

The Nationals have had a lot of injuries to position players such as Daniel Murphy, and to pitchers such as Steven Strasburg. President of baseball operations Mike Rizzo even went out and obtained closer Kelvin Herrera from the Royals, and now people are wondering whether they should flip Herrera and get some prospects back.

The Nationals are watching the Braves and Phillies dominate the division. With Wednesday’s loss, the Nationals are now a game under .500. You keep thinking it’s going to get better and then the Red Sox come in, put out funky lineups, and still take all three. Facing the Red Sox gave the Nationals an idea of how low they’ve sunk, because the Nats couldn’t beat the Sox if they played them 80 times. It’s that bad.

“We didn’t think that way the first game of the series,” manager Alex Cora said. “Today was a tough game. They have a good team. They’ll figure it out. They struggle a little bit and then figure it out. They’ll be in the hunt.”

Not sure I agree.

After the second game of the series, talk shows got on Bryce Harper because he admired his long drive to right and wound up at second base when most thought he should have been at third. Harper is becoming exceedingly frustrated with defensive shifts, which are eating him alive. It’s even prompted Harper’s agent, Scott Boras, to opine that shifts are killing power-hitting lefthanders and that they’re unfair and should be altered.

Thanks to the Nationals, things are looking up for the Red Sox. They have a day off Thursday and then play the lowly Royals over the weekend. The Sox finally have Tyler Thornburg back on the active roster. If Thornburg succeeds, the Sox may not have to give up prospects they don’t have to obtain a relief pitcher.

The Sox’ offense is also getting top production from Mookie Betts and J.D. Martinez. Devers had an interesting game in that he was picked off first base, made his 17th error on a poor throw after fielding a bunt, but then doubled to lead off the seventh and scored on that foul sacrifice fly.

The Red Sox are 59-29, which means they’re a really good team. They can easily beat the bad teams, and the ones who provide them an opening to win, which the Nationals did for all three games in the series. They’ve taken care of business against those teams.

And so we move on to the next city, and the next opponent the Red Sox should kick around. And we’ll say once again, “Wow, they’re really good.” But we’ll also wonder, can they beat the teams they need to beat?