Updated

San Francisco, CA (SportsNetwork.com) - Tim Hudson tossed seven scoreless innings and the San Francisco Giants blanked the Chicago Cubs, 4-0, in the middle test of a three-game set.

Hudson (5-2) scattered six hits for the Giants, who have won five of their last six games. Buster Posey posted two sacrifice flies in the triumph.

"It's exciting to go out there and give us a good chance to win," Hudson said. "Hopefully I can just keep it up, stay healthy, stay strong and just keep on keeping on."

Jake Arrieta (1-1) gave up four runs on seven hits and a walk over six frames for Chicago, which has alternated wins and losses over its last eight games.

"He battled," Chicago manager Rick Renteria said of Arrieta. "He minimized the damage. He gave up four runs but we just weren't able to put any offense together to kind of combat that."

The Giants plated a pair in the first and fifth for their scoring output.

Angel Pagan and Hunter Pence led off the home first with back-to-back singles to put runners on the corners. After Pence stole second, Posey lifted a sacrifice fly into right to bring home Pagan. Pence scored on Michael Morse's single two batters later to make it 2-0.

Ehire Adrianza began the fifth with an infield single and stole second after Hudson struck out. He moved to third on another infield single, this by Pagan, and the bags were full following a Pence walk. Adrianza scored on Posey's sac fly to left and Pablo Sandoval's base hit into left plated Pagan to give San Francisco a 4-0 advantage.

Jeremy Affeldt spun a scoreless eighth and Jean Machi struck out two in a 1-2-3 ninth to seal the win.

Game Notes

The Giants were 3-for-9 with runners in scoring position, while Chicago finished 0-for-4 with RISP and left six men on base ... Morse hit his 13th double of the season.