Hamels (12-10) allowed one run and six hits, striking out six in eight innings to win his fifth straight start - a career-best. Brad Lidge finished for his 24th save in 29 chances.
Brandon Beachy (0-1) gave up three runs - one earned - and four hits in 4 1-3 innings in his major league debut. He was a late fill-in for Jair Jurrjens, who is still nursing a sore right knee.