HOUSTON — Houston’s bullpen had thrown six scoreless innings entering the 12th inning on Monday night.

Then one pitch spoiled its good night and sent the Astros to yet another loss to the Texas Rangers.

Rougned Odor had three hits and three RBIs, including a solo homer in the 12th inning that lifted the Rangers to a 4-3 victory.

The Rangers, who have the best record in the American League at 86-59, improved to 14-3 against AL West rival Houston this season.

Odor launched his 31st homer over the short fence in right field off James Hoyt (1-1) to put Texas on top with no outs in the 12th.

“One pitch in the strike zone ruins it,” manager A.J. Hinch said. “It’s certainly a tough loss.”

Odor, who finished a triple shy of the cycle, has six home runs, six doubles and 19 RBIs in 16 games against Houston this season.

“He’s certainly hurt us a number of times over the last couple of years,” Hinch said. “He’s a good hitter. He’s a hitter that does damage. Certainly, against us, he comes up big at the worst times.”

Keone Kela (5-1) allowed one hit in two scoreless innings for the win and Jake Diekman pitched a perfect 12th for his fourth save.

Evan Gattis hit a solo homer off Sam Dyson with one out in the ninth to tie it at 3. The towering shot, which landed on the train tracks atop the left field wall, was the 26th homer for Gattis this season.

Marwin Gonzalez singled after that, but the inning ended when Colby Rasmus struck out and Gonzalez was caught trying to steal second base.

“Sometimes the bounces don’t go your way,” Hinch said. “There’s a lot of frustrating parts of this game, but none more so than the final score.”

Odor drove in one run with a ground-rule double in the Rangers’ two-run first inning. His RBI single in the third made it 3-1.

Texas starter Martin Perez yielded three hits and two runs with six strikeouts in 6 1/3 innings.

Gonzalez had an RBI single for Houston in the second and Tony Kemp’s pinch-hit, ground-rule double got Houston within one in the seventh.

Houston starter Doug Fister allowed six hits and three runs in five innings. He’s had a tough September, allowing 25 hits and 17 runs combined in three starts.

It was a disappointing loss for the Astros, who fell 3 1/2 games back for the second AL wild card.

“It’s always tough to lose, especially down the stretch,” Fister said. “Our fate is in our hands. We have to take care of business. We have to go out there and get (wins). Tonight we fell short.”

Astros rookie Alex Bregman went 0 for 5 with three strikeouts to end a 10-game hitting streak and Carlos Correa was 0 for 3 with a pair of walks to snap his hitting streak of 13 games.

TRAINER’S ROOM

Astros: LHP Dallas Keuchel, who hasn’t pitched since Aug. 27 because of inflammation in his left shoulder, will be shut down until at least Wednesday. Keuchel said they will decide then what his next step will be. Keuchel has had a tough follow-up to a 2015 season where he won a career-high 20 games and was voted the AL Cy Young Winner. Houston’s ace is 9-12 with a 4.55 ERA.

ALL AL WEST

Monday was the first of 19 straight games the Astros will play against teams in the AL West to end the season. They have seven games remaining against the Angels, six with the Mariners and three against the Athletics.

WHAT A CATCH

Elvis Andrus robbed Houston’s Max Stassi of a hit when he dived to grab a low liner for the first out of the 10th inning. Andrus sailed through the air to make the catch, hit the ground and rolled over before holding his glove up to display the ball.

UP NEXT

Rangers: A.J. Griffin (7-4, 4.92) will start for Texas on Tuesday. Griffin looks to bounce back after giving up a career-high eight runs in four innings of an 8-3 loss to Seattle on Wednesday.

Astros: Brad Peacock (0-0, 3.38) is scheduled to start his second game on Tuesday. He allowed five hits and one run in 3 2/3 innings of a 5-1 win against Cleveland in his first start this season on Tuesday.