Updated

Madison Bumgarner is still looking for his first victory after pitching his best game of the season Wednesday night.

James McDonald pitched six sharp innings for his first victory of 2011 and the Pittsburgh Pirates beat Bumgarner and the San Francisco Giants 2-0.

Bumgarner (0-4) was the tough-luck loser and remained winless despite allowing only one run and five hits in six innings with one walk and seven strikeouts. He cut his ERA to 6.17 from 7.79, but the Giants lost for the fifth time in six games to fall below .500 at 11-12.

"I thought Madison did a great job," San Francisco manager Bruce Bochy said. "He kept his poise and stayed away from the crooked number that has killed him. It's tough to not get runs for him. It'd be big to get him his first win."

McDonald (1-2) allowed four hits and four walks while striking out three. He lowered his ERA to 7.66 from 10.13.

"It feels like I got a monkey off my back with the first win," McDonald said. "I feel a little less stress now."

Mike Crotta, Joe Beimel, Chris Resop and Joel Hanrahan completed the five-hitter for Pittsburgh. Hanrahan recorded his seventh save in seven chances, getting Miguel Tejada to ground into a game-ending double play with runners on first and second.

Bumgarner was coming off a rough start, allowing four runs in 2 2-3 innings against Atlanta last Friday. While he did not get a win, Bumgarner believed he made progress.

"I felt smoother and worked out of some jams," he said. "I really was taking it one inning at a time instead of looking at the whole ballgame at once."

The Giants' offensive woes continued, though. They have scored just 14 runs in their last six games while hitting .188 with only one home run.

"We're too good of a club to get shut out like this," Bochy said. "Their guy pitched well but we've got to find a way to push some runs across. We've got to get these bats going. We've got some guys who aren't locked in."

San Francisco's best scoring chance came in the second inning when it put runners on second and third with one out. However, McDonald got Tejada and Bumgarner to ground out to end the threat.

One bright spot for San Francisco was that right fielder Cody Ross had two hits. He came into the game hitting .158 in his first five games after beginning the season on the disabled list with a strained calf.

"I went in with the approach of not trying to do too much," Ross said. "I think, as a team, we're all trying to do too much right now. We need to just let the hits come to us instead of everyone trying to hit a home run every time up."

Chris Snyder and Jose Tabata each singled in a run for the Pirates, and Neil Walker and Steve Pearce had two hits apiece.

Walker scored the game's first run in the second inning when he singled off Bumgarner's glove, took third on Pearce's double and scored on Snyder's hit into center field. Tabata's two-out single to right field off Guillermo Mota in the seventh scored Brandon Wood, who had singled, and made it 2-0.

NOTES: San Francisco INF Mark DeRosa is likely to be placed on the disabled list Thursday because of inflammation in his left wrist, which was surgically repaired each of the last two years. Triple-A Fresno INF Emmanuel Burriss was scheduled to arrive in Pittsburgh late Wednesday night to be available to play in Thursday afternoon's game if DeRosa goes on the DL. ... San Francisco RHP Ryan Vogelsong is scheduled to make his first major league start since Sept. 29, 2004, on Thursday. Vogelsong's last start came for Pittsburgh. ... OF Xavier Paul, claimed off waivers from the Dodgers on Tuesday, arrived in the Pittsburgh clubhouse following the game. OF John Bowker said he was told by the Pirates that he will be designated for assignment on Thursday to clear a roster space for Paul. ... Pittsburgh 1B Lyle Overbay, who has only one extra-base hit in his last 14 games, was not in the lineup for the second time in three games, and SS Ronny Cedeno was benched a night after failing to run out a groundball in a 3-2 loss to the Giants in 10 innings.