Tim Lincecum, a two-time Cy Young Award winner, was outpitched Friday night. Of course, everyone has looked dominant against the scuffling San Francisco lineup lately.

The Giants' ace allowed three earned runs — more than he had in his previous three road starts this season combined — but even one would have been too many. Nationals starter Jason Marquis threw a five-hit shutout and helped his own cause with an RBI single, and Laynce Nix punctuated a rare start with two-run homer to help Washington knock off the Giants 3-0 on Friday night.

The Giants have lost six of their last eight games, and again their offense was largely to blame. In five of those setbacks they have scored two or fewer runs and have been kept off the scoreboard in two of the last three games overall.

"Hitting's contagious," manager Bruce Bochy said. "So is not hitting. Right now we've got a serious virus in this lineup."

Aubrey Huff was hitless for the sixth time in his last eight games, dropping his average to .202. He's far from alone. Bochy has already made lineup adjustments during the scoring slump and said more could be coming.

"We're in a tough rut right now, there's no getting around it," he said. "We've got some guys that are fighting it."

Lincecum (2-3) had seven strikeouts in seven innings to take over the major league lead, but dropped his second consecutive decision. After issuing six walks — and allowing five earned runs — in his previous start, he did not walk any of the Nationals' hitters, but finding the plate too often proved to be costly. Both Nix's home run and Marquis' RBI single came with two strikes.

"I threw maybe too many strikes, or at least too many with two-strike counts," said Lincecum, who had allowed only two runs in his previous 21 1-3 innings on the road. "I didn't have any walks, but when you come up with a loss, it's not all that gratifying."

With one out in the second, Wilson Ramos reached second base with a double thanks to a misplayed fly ball by the Giants. Center fielder Aaron Rowand appeared to have a bead on Ramos' tailing drive, but right fielder Cody Ross collided with him and the ball popped out of Rowand's glove.

Making his sixth start of the season, Nix drove a 1-2 breaking ball to right for his third homer. It was the second one Lincecum has allowed this year.

"It was my first time facing Tim and I was fortunate to get a pitch over the plate I could handle," Nix said.

After Ian Desmond singled and stole second in the fifth inning, Lincecum went up 0-2 in the count on Marquis. Always a dangerous hitter, Marquis smacked a rising fastball into center field to bring home Desmond for a 3-0 lead.

"Give him credit, he's a good hitter and has a good eye, especially for a pitcher," Lincecum said. "I wanted to go up and I think I just found his bat."

Marquis (3-0) struck out seven and walked none in his fourth major league shutout and first since 2009 with Colorado. The right-hander threw 96 pitches in his seventh career complete game, dispatching the Giants in a game that took only 2 hours, 9 minutes.

"I can't say we had the best approach against him, but give him credit where credit is due," Ross said. "We're trying to do too much and it helps him out when we're wailing at the first pitch."

NOTES: Giants outfielder Andres Torres, on the disabled list since April 15 with a left Achilles' strain, played four innings in an extended spring training game in Arizona and stole a base. ... Miguel Tejada, mired in a 4-for-32 slump entering the game, was bumped up to seventh in the Giants' lineup. "We'll see if we can jump-start him there," Bochy said.