Ray gave up two runs in five innings and struck out a career-high eight batters, lowering his ERA to 2.29 in nine starts.
"I'm mixing in the slider and changeup more than I have and that was working for me as long as I was keeping it down in the zone," Ray said. "The couple that I left up, they put good swings on it. But for the most part, it was good."
Ray has allowed two runs or fewer in seven of his nine outings this season, including again Friday night. He gave up a season-high eight hits, but worked out of jams and had good command, throwing 72 of his 99 pitches for strikes.
But he also lasted just five innings, largely because the Giants' batters fouled many pitches off and had long at-bats against him.
D-backs manager Chip Hale said he was pleased with Ray giving the team a chance to win, as Arizona had a 4-2 lead when he exited. Hale also knows the difference in whether Ray is good or bad depends heavily on his slider and changeup.
"When he threw the good ones, they couldn't hit them," Hale said. "It's just when he hung them a little bit, they were able to put them in play."
Even though the Giants were able to capitalize in those instances, Ray said it was important that he was able to go back to those pitches and not just have to rely on the fastball.
"I was able to come back and use it effectively and felt pretty good overall," Ray said. "It's just something to build off of."
Jake Rill is an associate reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.