Bumgarner (11-5) retired 13 straight until Chris Snyder's solo shot in the seventh inning in another dominating start for the blossoming lefty. He struck out five and walked two.
Posey hit his team-leading 11th home run of the season in the first off Wandy Rodriguez, who allowed seven hits and two walks in seven innings. Rodriguez (7-7) also had four strikeouts to begin a 10-game road trip for the last-place Astros.
Santiago Casilla struck out the only two batters he faced for his 22nd save in 26 chances.
Pablo Sandoval put the punctuation on a fog-filled night under the lights in San Francisco's waterfront ballpark by following up his bases-clearing triple in the All-Star game with a triple in the eighth.
ROCKIES 6, PHILLIES 2
DENVER (AP) — Christian Friedrich pitched six strong innings, and Josh Rutledge had two hits and two RBIs in his major league for Colorado.
Friedrich (5-6) got the best of Cliff Lee (1-6) in his first career appearance against the Phillies, who have lost five straight and 11 of their past 12 games.
In winning for the first time in more than a month, Friedrich allowed one run and five hits, struck out seven and walked one.
Lee, who got his only win of the season in his previous start July 4 against the New York Mets, allowed three runs — two earned — and nine hits in six innings.
Philadelphia fell to 4-11 in Lee's starts this season after going 22-10 in his 32 starts a year ago.
BREWERS 10, PIRATES 7
MILWAUKEE (AP) — Cody Ransom hit his first career grand slam with two outs in the eighth inning.
Ryan Braun hit two home runs as Milwaukee improved to 40-6 against Pittsburgh at Miller Park since 2007. Martin Maldonado finished with a career-high four hits, all singles, to hand Pittsburgh only its third loss in the last 13 games.
Pittsburgh reliever Tony Watson (4-1) entered in the eighth and gave up consecutive singles to Braun and Aramis Ramirez. He struck out Corey Hart, but each runner stole a base on the pitch. The Pirates elected to load the bases by intentionally walking Rickie Weeks to face Ransom, who was 0 for 4 in the game.
Pittsburgh's Andrew McCutchen hit a solo homer off John Axford of Simcoe, Ont., in the ninth.
Francisco Rodriguez (2-4) pitched the eighth.
BRAVES 7, METS 5
ATLANTA (AP) — David Ross homered and drove in four runs and Chipper Jones also connected.
The Braves started the day thin at shortstop. They chose to wait to replace rookie Andrelton Simmons, who broke his right little finger on Sunday and will be out at least a month. Atlanta then lost shortstop Jack Wilson with another pinkie injury.
Wilson's exit forced Martin Prado, the starter in left field, to play shortstop for the first time in four years.
Cristhian Martinez (4-1) pitched out of a bases-loaded jam in the fifth. He gave up one walk with two strikeouts in one inning.
Craig Kimbrel earned his NL-leading 26th save with three strikeouts in the ninth.
Chris Young (2-3) gave up five runs on six hits and three walks in three innings.
DODGERS 2, PADRES 1
LOS ANGELES (AP) — Clayton Kershaw pitched in and out of trouble for six innings, Mark Ellis hit his third homer of the season, and Andre Ethier and Matt Kemp returned to the Los Angeles lineup.
Kemp was 2 for 4 with a double after missing 51 of the Dodgers' previous 53 games because of a left hamstring strain. Ethier, sidelined since June 28 because of an oblique strain on his left side, was 0 for 2 and got hit by a pitch following a two-game rehab stint with Class-A Rancho Cucamonga during the All-Star break.
Kershaw (7-5) allowed a run, six hits and three walks while striking out six.
Javy Guerra and Ronald Belisario both pitched a scoreless inning and Kenley Jansen worked a hitless ninth for his 16th save in 19 attempts
Clayton Richard (6-10) allowed two runs and five hits in 7 1-3 innings.
NATIONALS 5, MARLINS 1
MIAMI (AP) — Ryan Zimmerman hit a two-run homer and Jesus Flores drove in two runs.
Jordan Zimmermann (6-6) pitched six scoreless innings allowing four hits and striking out six for the Nationals, who have won six of eight.
Josh Johnson (5-6) lost to Washington for the first time in his career as he allowed five runs and 11 hits in 5 1-3 innings. Johnson was 8-0 in 15 starts against the Nationals.
REDS 5, CARDINALS 3
CINCINNATI (AP) — St. Louis first baseman Allen Craig's throwing error in the seventh inning helped the Reds rally for their fourth straight win.
Craig fielded Ryan Hanigan's slow grounder with the bases loaded and threw wildly to first base, allowing two runs to score for a 3-2 lead off Adam Wainwright (7-9). Zack Cozart's sacrifice fly completed a three-run rally.
Todd Frazier had a solo homer off Wainwright, who allowed only two hits over the first six innings before letting it slip away. Brandon Phillips had three hits and scored twice.
Alfredo Simon (1-1) escaped a bases-loaded threat in the seventh by striking out Matt Holliday. Aroldis Chapman fanned three in the ninth for his 12th save in 16 chances, repeatedly hitting 101 mph on the radar gun.
CUBS 8, DIAMONDBACKS 1
CHICAGO (AP) — Alfonso Soriano homered twice, doubled twice and had five RBIs in a game that was delayed at the start nearly four hours by rain.
Soriano hit a solo homer in the fourth inning and a three-run shot in the fifth off Ian Kennedy and added a run-scoring double in the seventh off Brad Ziegler.
Kennedy (6-8) gave up seven hits and six runs in five-plus innings, hitting a batter, walking two and throwing two wild pitches.
Paul Maholm (7-6) allowed six hits and a run in seven innings to win his third straight start. He drove in a run with a bunt in the sixth inning.