Jim Hunter and Mike Boddicker talk with Juan Samuel following the O's 4-3 loss
It was Butler's 10th homer of the year and the 50th of his career. Hernandez had come on in the eighth with a 3-2 O's lead after Bergesen's strong start.
He pitched seven innings and gave up just five hits and two runs, throwing 98 pitches.
Bergesen, who was 0-5, 7.20 over his last five starts, was seeking his first win since May 12 vs. Seattle.
The Orioles scored three runs in the sixth inning for a 3-1 lead. Julio Lugo and Brian Roberts led off with singles and scored on a Nick Markakis double to left center for a 2-1 lead.
Two batters later, Adam Jones singled to right to score Markakis.
The Orioles, who were just 2 for 35 with runners in scoring position on the first five games of this trip, were 2 for 4 tonight in the sixth inning.
The winner was 2009 Cy Young winner Zach Greinke, who pitched eight innings of seven-hit ball to improve to 7-10, 3.97. Joakim Soria pitched the ninth to record his 28th save in 30 chances.
The Orioles, who have lost seven of their last eight, fall to 3-13 since the All-Star break and 32-72 on the year.