Jayson Werth, Chris Coste and Chase Utley homered for the NL East leaders, who snapped a two-game losing streak.
Making his first start since spraining his left ankle on April 28, Hamels (1-2) allowed two runs. Hamels was MVP of the NL championship series and World Series last year, but struggled the first month. He lowered his ERA to 6.17.
Atlanta's Casey Kotchman hit a three-run homer off Brad Lidge in the ninth, and Omar Infante also went deep.
Braves starter Jo-Jo Reyes (0-2) lost his ninth in a row, allowing eight runs four earned and five hits in five innings.