Ryan Madson (2-0) got the win in relief of Hamels, who gave up two runs and 11 hits over seven innings.
Chad Tracy homered for the Diamondbacks in their third loss in five games.
Chad Qualls (2-7) took the loss, allowing four runs in one-third of an inning.
Jessica Simpson shares three-way kiss with friends in photo
Senate Democrats to pull all-nighter on climate change