Ray (3-4) came into the game riding a three-start losing streak, and in his prior outing, he had allowed a season-high four runs.
Tuesday he commanded his fastball and was able to throw his offspeed pitches for strikes when he needed to as heturned in his finest start as a D-back.
"He was really electric," D-backs manager Chip Hale said. "His fastball was good, he was able to spot it, he used his offspeed stuff enough to keep them off-balance. But he just has that electric fastball, and he was just able to get a lot of swings-and-misses and popups."
Ray walked Prince Fielder in the first inning, but it wasn't until Elvis Andrus singled to right with two outs in the fifth that the Rangers were able to get a hit.
"I just felt like everything was working," Ray said. "Mostly my fastball command. That's something that I stressed in the last [bullpen session], and needed to work on. I was able to command my fastball to both sides of the plate."
The Rangers got to Ray in the eighth, scoring a pair of unearned runs thanks to a three-base error by right fielder Yasmany Tomas that started the frame.
Ray was able to retire the next two hitters after the error, but then allowed a double and a single before Hale finally went to get him.
"I probably left him in one hitter too long, to give up that other run, but he did a great job," Hale said. "He earned the right to stay out there and pitch."
The 7 2/3 innings marked the longest outing of his big league career.
"A little tired, but it's no excuse," Ray said of the eighth. "I could feel myself getting a little tired, but told myself to go out there and compete."
Once Ray was able to establish his fastball, it opened up other pitches.
"I tried to mix in some breaking balls to keep hitters off my fastball, and just kind of pitch backward a little bit," he said. "Threw the slider in fastball counts and the fastball in slider counts. It worked out for me."
After struggling during Spring Training, when he was competing for a spot in the rotation, Ray has been outstanding in his eight big league starts this year, his previous start his one small blemish. His outing Tuesday dropped his ERA to 2.16.
Ray credits the improvement to better focus and the ability to make corrections on the mound quicker than in the past.
"He works quick, he pounds the zone, and it's easy to play defense behind him," D-backs third baseman Jake Lamb said.