He didn't need the cushion. Hamels floated his devastating changeup five straight times to Bonds, who fouled the first four off before missing the fifth.
"That at-bat should tell you how good that kid's changeup is," catcher Rod Barajas said. "To throw the same pitch five times in a row and have Barry do nothing with it should tell you something. It's a deadly pitch."
Barajas called a few fastballs during that sequence, but Hamels wanted none of that.
"I couldn't see [the sign], so I just shook [no] so he'd put another sign down," Hamels said. "I think he put a fastball down, but I was going with my gut. That's the way I've been able to be successful.
"He was still swinging hard, so I'm not going to give him a gift and throw him a fastball."
"Anytime he wants to throw that pitch, I'm fine with it," Barajas said.
Before the largest crowd this season (45,153), Hamels (8-2) allowed two runs and five hits, while striking out five and walking none. Though Antonio Alfonseca was warmed and ready for the ninth inning, he only watched as Hamels dazzled through his 98-pitch effort.
"He's incredible," Barajas said of the left-hander.
"Hamels is pretty good," added manager Charlie Manuel. "He even makes me a good manager, doesn't he? This game was very important to us and he stepped right up. He's been stepping up for us all year."
Just like that, the Phillies temporarily exorcised two demons by snapping a four-game losing streak and beating a lefty in Noah Lowry (5-5), upping their mark against southpaws to 6-14. The Phillies' last victory over a lefty came on May 11, when they beat Chicago's Rich Hill.
After totaling five hits in their previous two games, the Phillies broke out with six against Lowry, though they used them wisely, accounting for five runs. Philadelphia also played small ball, with three of the runs coming via sacrifice flies.
One of those turned better when Bonds, an eight-time Gold Glove winner, muffed Ryan Howard's drive to the warning track for a two-base error.
"I went back on the ball, I turned my head, I looked up, I lost it for a split second and I got it back and I knew I couldn't put my head back down to get to the spot that I wanted to," Bonds said. "... It just cupped me."
The play was ruled a sacrifice fly and an error, as Jayson Werth scored, Chase Utley went to third and Howard wound up on second with no outs. The Phillies added their second run when Pat Burrell lofted a sacrifice fly to right.
Philadelphia added another pair of runs in the fifth, and that was enough for Hamels, who defeated the Giants for the second time this season.