Hamels recovered from a shaky start to record his best performance yet for Texas, striking out 10 in eight innings and allowing two hits during the Rangers' 4-1 win over the Orioles.
Baltimore was limited to three hits — one over the last six innings — while losing for the eighth time in nine games to fall 3 1/2 games behind Texas in the race for the American League's second wild-card berth. In each loss, the Orioles have scored three runs or fewer.
"We just not stringing much together offensively," Baltimore manager Buck Showalter said. "It's tough on our pitchers because they know runs are going to be at a premium.
"(Hamels) was good, and we weren't very good. So, that was a bad combination. That's the kind of guy you get for six prospects."
Hamels gave up a second-inning single to Matt Wieters and a third-inning double to Paul Janish, the latter followed by three walks that scored Baltimore's run.
Following the bases-loaded walk to Chris Davis, Hamels retired the next 14 batters. Jonathan Schoop struck out three times against Hamels and also for the final out to Shawn Tolleson, who earned his 27th save.
"I tip my cap to him," Schoop said of Hamels, the three-time All-Star who was acquired from Philadelphia just before the July 31 non-waiver trade deadline. "He threw his curveball for a strike. Threw a cutter. Everything was working for him."
Kevin Gausman (2-6) allowed four runs and nine hits in 6 2/3 innings. He has made 11 starts this season, beginning in late June, with one win.
"To have a little skid like this obviously doesn't feel good," Gausman said. "But we're one hit away, one pitch away. I think that's the biggest frustrating thing."
Star outfielder Adam Jones started for the Orioles, a day after he ran into a wall and was forced to leave. Jones went 1 for 4 with two strikeouts and threw out Prince Fielder trying to stretch a single into a double in the fourth inning.
Showalter said Jones looked "OK" both at the plate and in the field.
"I think Hamels had as much to do with that as anything," Showalter said. "He had one of our three hits. Made a throw that not many people could."
Baltimore outfielders had two assists. The Orioles entered the game with 37 outfield assists, tied with Minnesota for the major league lead.
Orioles outfielder Dariel Alvarez made his major league debut after being called up from Triple-A Norfolk earlier in the day. The Cuban went 0 for 3. In the second inning, Alvarez ran down a sinking liner hit by Elvis Andrus and threw home to nab Adrian Beltre to complete a double play. "He's definitely kind of a freak athlete," Gausman said.
Orioles: SS J.J. Hardy (groin) rejoined the team while on the disabled list through Sept. 8. He'll go through light workouts before swinging a bat or running.
Rangers: OF Josh Hamilton (sore left knee) took batting practice. He's eligible to come off the disabled list on Monday, the day before rosters are expanded.
Orioles: RHP Ubaldo Jimenez (9-8) has lasted six innings in one of five August starts.
Rangers: LHP Martin Perez (1-3) will pitch on eight days' rest. In his seven starts since being activated in mid-July following Tommy John surgery, Perez hasn't allowed a home run in 37 1/3 innings.