Hamels (7-13) gave up just two hits, both homers, and two runs over eight innings. He struck out nine and walked two. He retired the side in order four times.
B.J. Rosenberg earned his first career save with a perfect ninth inning.
David Carpenter (3-1) took the loss for allowing Ruf's homer in the eighth.
Evan Gattis hit two solo home runs for the Braves. His first, in the second inning, traveled 480 feet to center field. In the seventh, he tied the game with a long ball that went deep into the left-field bleachers. It was his first career multi-homer game.
Chase Utley doubled and Darin Ruf singled to knock in the Phillies' first two runs in the first inning. Utley and Ruf both finished with two hits apiece.
Braves starter Paul Maholm went six innings and allowed two runs on seven hits, three walks and a hit batter. He struck out five and stranded seven Phillies baserunners.
Two baserunning blunders by Cesar Hernandez may have cost the Phillies extra runs. He was picked off in the first inning and thrown out by Joey Terdoslavich attempting to go first to third in the fifth inning.
Philadelphia squandered a chance for more runs in the sixth. After the first two men reached base via a walk and an error, Freddy Galvis grounded into a double play and Hamels struck out.
B.J. Upton, who went 0 for 4, finished the series 0 for 12 with seven strikeouts. B.J. and Justin Upton are hitless in their last 32 at-bats combined.
The Braves had just 10 hits in the series.