Phillies left-hander Cole Hamels gave up three runs -- all coming on a home run by left fielder Michael Morse -- in seven innings. He allowed nine hits and two walks, striking out five.

Hamels failed in his attempt to tie the franchise record for most consecutive starts of seven or more innings allowing one run or fewer. He entered the game with five in a row.

Hamels had held the Giants scoreless for three innings despite giving up hits in each. But that changed in the fourth when three consecutive hits -- each of a greater distance -- combined to put the Phillies in a 3-0 hole.

Catcher Buster Posey got the uprising started with a single to right field. He advanced to third when Sandoval one-hopped a ground-rule double over the fence in left-center field.

The Phillies chose to pitch to Morse with a base open, and it cost them. The Giants' leader in home runs lined his 16th well over the 382-foot marker in left-center field, just San Francisco's third homer in its last 10 games.

Byrd's homer, his team-leading 23rd of the season, came on Bumgarner's second pitch after having been staked to the three-run lead.

NOTES: The visiting team has won the last four series between the Phillies and Giants. ... Phillies RF Marlon Byrd's career-high for home runs is 24, set last season. ... The home run by Giants LF Michael Morse was just his third in his last 196 at-bats, a span of 57 games. ... The Phillies are now 16-11 record against the National League West. They need just one more win in six remaining matchups to post a winning record against the West for the seventh consecutive year. ... Giants 1B Brandon Belt has an appointment to see Dr. Micky Collins, a concussion specialist, in Pittsburgh on Monday. ... The Giants' game at Detroit on Sept. 7 has been selected as the ESPN Sunday Night Game and has been moved to 5:07 p.m. PT. ... The Giants' former home in San Francisco, Candlestick Park, was formally closed Thursday night after a concert by ex-Beatle Paul McCartney. The Giants played their final game at the 'Stick in September 1999.