"We got some good pitches to hit and we just didn't get the barrel on them," interim manager Tom Lawless said. "We hung around in that game. We could have scored a lot of runs. They left 12 guys on base and we're still in the ballgame, 2-0. We just couldn't put anything together offensively until the ninth."
Dexter Fowler singled with one out off Cotts, while Jake Marisnick came off the bench and shot a double to right to put runners in scoring position. Matt Dominguez hit a sac fly to score Fowler, but Cotts rallied to get Jonathan Villar to ground out and end the game.
"Look at the ninth inning," Lawless said. "We got second and third with one out, we get a base hit and it's a tie game. If someone runs into one, we got the lead. Keep on going. There's no quit. Like I told you a long time ago, there's 27 outs in the game and we're going to play 27 outs."
Rangers starter Nick Martinez (5-11) held the Astros to five hits and no walks, while striking out five batters in 6 2/3 scoreless innings, and the Texas bullpen finished off the Astros.
"Those are the type of things he needs to do to continue to grow," Rangers interim manager Tim Bogar said. "It's been really neat to see his ability to repeat things. Tonight was a good night for him in that aspect, being able to repeat the fastball, being able to repeat his slider, it was really nice."
Astros second baseman Jose Altuve, who leads the Majors in hits and batting average, went 0-for-4 as Houston fell to 7-23 in games in which he didn't get a hit.
"He's pretty much our catalyst," Lawless said. "We go the way he goes most of the time, and without him getting on base and forcing the issue, we couldn't get anybody else to get out there and do anything until the ninth."
The Rangers had two runners on base in each of the first three innings against Astros lefty Brett Oberholtzer, but they went a combined 0-for-5 with runners in scoring position as the game remained scoreless through three.
"Unfortunately, every inning was pretty stressful with a lot of baserunners and it put me in some pressure situations," said Oberholtzer, who finished his season 5-13 with a 4.39 ERA in 24 starts.
Robinson Chirinos led off the fourth inning with a homer to straightaway center field, and J.P. Arencibia followed with a double. He moved to third on a sac bunt and scored when Daniel Robertson ripped a single up the middle, making it 2-0.
Oberholtzer was pulled after giving up consecutive one-out singles in the fifth, marking the second time in three starts he lasted just 4 1/3 innings.
"It wasn't his best stuff tonight," Lawless said. "He was behind in the count, but he battled through all those innings. Leaving the game 2-0, it could have been worse than that."
Astros reliever Mike Foltynewicz started the seventh by allowing two hits, a wild pitch and a walk to load the bases with no outs. Pitching coach Brent Strom came on to talk to him, and Foltynewicz came back to strike out Chirinos and get Arencibia to hit into an inning-ending double play.
"He put himself into a pickle there and he [bore] down and made pitches, and got the inning-ending double play," Lawless said. "Credit to him. He could have folded the tent there, but he didn't. He battled and made some pitches, and got the key strikeout and the double play."