ARLINGTON, Texas (AP) Robbie Ray gave Arizona a glimpse of the future and Diamondbacks manager Chip Hale liked what he saw.
Ray took a shutout into the eighth inning to outpitch Texas' Yovani Gallardo, and the Diamondbacks beat the Rangers 4-2.
Ray (3-4) pitched four-hit ball with one walk over a career-high 7 2/3 innings. The rookie didn't give up a hit until Elvis Andrus' single with two outs in the fifth.
''He's opened my eyes,'' Hale said of Ray. ''I'm really excited about his future because he's going to get a better breaking ball and trust his changeup more and he's going to have three pitches. He's going to be a pretty good pitcher for us.''
The left-hander beat an established good pitcher. Gallardo came into the game with 29 1/3 consecutive scoreless innings, and didn't give up a run until Jake Lamb's two-run, broken-bat single with two out in the fifth.
''We were hitting the ball hard,'' Lamb said. ''And then I come up and break my bat, don't hit the ball hard, and that's two RBIs. They say `They even out,' and in that case they did.''
Gallardo's streak ended at 33 1/3 innings.
A.J. Pollock's RBI single with two outs in the sixth made it 3-0 and chased Gallardo (7-7).
Paul Goldschmidt had two hits, including an RBI single in the eighth.
The Rangers got on the scoreboard in the bottom of eighth as Arizona right fielder Yasmany Tomas missed Andrus' line drive for a three-base error and Andrus scored on Shin-Soo Choo's sacrifice fly. Delino DeShields doubled with two outs and scored on Rougned Odor's single, chasing Ray.
Brad Ziegler pitched a perfect ninth inning for his career high-tying 13th save in 15 opportunities.
The Diamondbacks won for the fourth time in five games and handed Texas its fourth straight loss.
Rangers pitchers have allowed 37 runs and 60 hits during the losing streak.
Ray's 91 pitches were his lowest total in eight major league starts this season.
''The key is to always get ahead of hitters,'' he said. ''If you get ahead, then you can pitch your game, and that was the key tonight.
''I felt like everything was working, especially my fastball command.''
Rangers manager Jeff Banister agreed.
''I think the finish on the fastball is what got us.''
Gallardo allowed eight hits and five walks. The Diamondbacks put their first two batters on base in both the second and fourth innings. Texas turned double plays on balls in the air to stop both threats.
Ex-Ranger Jarrod Saltalamacchia was Arizona's designated hitter, going 1 for 4 with a walk. Hale said right-handed batter Aaron Hill would be in Wednesday's lineup, either as the DH or third baseman. If Hill plays third, Lamb would move to first base with Goldschmidt as the DH.
Joining Goldschmidt at his third All-Star game next week in Cincinnati will be a first-timer, OF A.J. Pollock. Hale said, ''I called him (Monday, an off day) to let him know. He was with his wife at the hotel, so they got to find out together.''