HOUSTON -- After twice seeing the Houston Astros rally late for wins in this series, the Texas Rangers were determined to pile on runs after getting a lead on Thursday.
They were able to do that, adding four runs in the eighth and ninth innings combined to pad the lead and cruise to a 10-4 victory.
Joey Gallo homered and drove in three runs, Rougned Odor and Elvis Andrus also homered and the Rangers stopped a season-worst four-game skid with the win.
The Rangers went ahead 4-0 in the first inning and used the bullpen to help avoid a four-game sweep.
"You can't have too many runs," Gallo said. "They come in bunches here, popups end up going out. Today was a little bit different. The wind was kind of blowing in, but you can never have enough runs."
Marwin Gonzalez homered in his fifth straight start for Houston.
Odor's homer off Joe Musgrove (1-3) came with one out in the first. Singles by Nomar Mazara, Carlos Gomez and Gallo made it 2-0 with two outs and Mike Napoli hit a two-run double.
Gallo padded the lead with a two-run homer in a three-run eighth inning and Andrus had a solo shot in the ninth.
"Great challenge for our bullpen ... they continued to grind it out and got the outs when we needed," manager Jeff Banister said. "But the story was that the offense continued to put runs on the board for us."
A.J. Griffin (3-0) picked up the win, yielding one earned run in five innings in his return from the disabled list because of gout in his left ankle.
The Astros had some chances late to cut the deficit, but failed to get a big hit when they needed it on a day when they went 2 for 14 with runners in scoring position.
"We are pretty good with runners in scoring positions and (Thursday) obviously we gave ourselves a lot of opportunities and it's easy to say what if or how the game would have changed if we were able to come up with a big hit with bases loaded," manager A.J. Hinch said. "But if we keep giving ourselves this many opportunities, we are going to like the outcome."
An RBI single by Evan Gattis cut the lead to 4-1 in the first inning.
Texas added a run in the second inning on a sacrifice fly by Mazara. Andrus scored on a balk by Brad Peacock to make it 6-2 in the fifth.
A bases-loaded sacrifice fly by Carlos Beltran cut the lead to 6-3 before Josh Reddick walked to load the bases again. Jeremy Jeffress took over and Jose Altuve grounded into a double play to allow Texas to limit the damage.
A sacrifice fly by Gonzalez made it 6-4 in the seventh inning, but Keone Kela struck out Beltran with the bases loaded to keep Houston from getting any closer.
Astros: RHP Collin McHugh (right elbow injury) will travel with the team on Thursday and begin playing catch at a short distance sometime this weekend. ... OF Teoscar Hernandez, who injured his left leg in a collision with Altuve last week, is expected to begin a minor league rehabilitation assignment sometime in the next week.
Gonzalez launched a solo shot to right-center field in the fourth. He leads the Astros with nine home runs and has six in the last five games after hitting two, including his first career grand slam, on Tuesday night.
"He was certainly a huge difference maker in this series and it has earned him a ton of playing time," Hinch said. "He's the everyday player we don't call an everyday player because he moves around the field."
With three home runs, the Rangers moved to second in the American League behind the New York Yankees with 43. They've been on a tear lately, piling up 12 in their last five games.
Rangers: Yu Darvish will start for Texas in the opener of a three-game series at Seattle on Friday. Darvish will be pitching on an extra day of rest after the Rangers pushed him back after he threw 115 and 126 pitches in his last two starts. He is 0-3 with a 7.71 ERA in three career starts at Safeco Field.
Astros: Dallas Keuchel looks to improve to 6-0 when he starts the first game of a three-game series against the Angels on Friday. Keuchel was the AL pitcher of the month for April after posting a 1.21 ERA in six starts.