HOUSTON (AP) -- Dallas Keuchel was within one pitch of making one of the best starts of the season for the Houston Astros.
Instead, like many aspects of the Astros' season, things got ugly in a hurry in a 6-1 loss to the Texas Rangers on Sunday.
Making his first start since July 27 after a two-week stint in the bullpen, Keuchel had two outs and two strikes on Craig Gentry. Despite trailing 2-0, he was a pitch away from the first complete game of the season for Houston when Gentry was hit by a pitch.
"I'd like to have the pitch back to Gentry," Keuchel said. "I thought if I didn't hit him, I'd have a good shot of getting him out."
With the bases loaded, Jurickson Profar hit a single to right field that cleared the bases when it was followed by a throwing error by L.J. Hoes, and Profar scored on Leonys Martin's single to make it 6-0.
Houston manager Bo Porter then decided a complete game was no longer in the cards for Keuchel.
"I told him, 'You pitched one heck of a game, hold your head high, you don't have anything to hang your head about because you battled this guy pitch-for-pitch,'" Porter said, referring to Rangers starter Martin Perez. "Defensively, we let him down."
Keuchel carried a perfect game into the fifth inning before Alex Rios beat out an infield single when shortstop Jake Elmore double-pumped a throw. Geovany Soto then put the Rangers ahead 1-0 with a ground-rule double to center field.
Rios laced a two-out double down the right-field line in the sixth to extend the lead to 2-0. Elvis Andrus reached on an error with one out and advanced to second on Adrian Beltre's single before scoring on Rios' double.
"When you talk about three outs per inning, you cannot give teams extra outs," Porter said. "When you look at the first two runs, they scored when we gave them extra outs. They took advantage of it and scored runs. If not, you may go into the ninth inning tied. At the end of the day, you have to play fundamentally sound baseball."
Keuchel (5-7) allowed six runs and eight hits with eight strikeouts in 8 2-3 innings. He was the second Astros starter to go into the ninth this season, as Bud Norris threw eight-plus innings May 8 against the Los Angeles Angels.
While Keuchel kept Houston in the game, the offense wasn't able to get anything going against Perez (5-3).
Perez threw a four-hitter for his first career complete game, leading the Rangers to their seventh straight victory and 12th in their last 13 games.
Chris Carter ruined Perez's shutout bid with a home run with two outs in the ninth inning.
Perez (5-3) struck out a career-high eight while walking two in earning his second straight win. Perez has allowed four runs over his last 22 2-3 innings, spanning his last three starts.
Perez retired 15 of 17 batters from the third to the eighth, including nine in a row before Elmore's single with two outs in the eighth.
"I think we were overly aggressive," Porter said. "It would have been a better idea to slow the game down and get the pace in your favor, but it felt like the more outs he recorded, the quicker our at-bats got."
Houston has lost five in a row and nine of the last 10 games. The Astros own the worst record in the majors at 37-79.
"We're in all the games close until the end, but then something happens and the other team wins," Carter said.
Thanks to Keuchel's lengthy start, the Astros' bullpen ended a four-game streak of allowing at least one run. Reliever Jorge De Leon got Andrus to ground into a force out in relief of Keuchel.
"We've been in position to win ballgames, but this is major league baseball," Porter said. "Nobody is walking away feeling like it's a moral victory. I don't believe in moral victories, in the first place."
NOTES: Houston SS Jonathan Villar, who had not started the previous three games because of a left thumb sprain, did not start Sunday's game, either. Porter said Villar was not in the lineup Sunday because the Rangers were starting a left-hander and the thumb bothers Villar more batting right, but Villar is expected to start Monday. ... Astros starters have posted a 3.69 ERA and seven quality starts in their last 11 games.
Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.