Rosales continued his strange season of bouncing back and forth between the two pennant contenders in the American League West by playing a key role in the Rangers' third straight victory and their 18th win in 22 games.
Texas moved 2 1/2 games in front of Oakland at the top of the division.
Houston rallied for two runs in the eighth to tie it, but Texas came up with the winning run in the ninth against Chia-Jen Lo (0-1).
Lo, making his eighth major league appearance, retired the Rangers in order in the eighth and then came out for another inning of work.
He gave up a leadoff single to Mitch Moreland and Rosales came on as a pinch-runner. Jurickson Profar next drew a walk and, one out later, Leonys Martin drew another one.
Andrus, who had driven in a run with a squeeze bunt in the seventh, then hit a 1-0 pitch deep enough to left field to score Rosales.
Rosales began the season with Oakland, but was optioned for assignment and the Rangers claimed him. Texas then optioned him and Oakland put in a claim. But Oakland again optioned Rosales, who once more landed with the Rangers.
He is in his sixth major league season and owns a .219 career batting average with three clubs.
The ninth-inning run gave the win to Joe Nathan (4-2), the Rangers' closer who worked the top of the ninth in what was then a tie game.