Though he surrendered a season-high seven hits in 6 2/3 innings, Gray fanned eight and worked out of numerous jams to move OU to 6-1 in conference play and 26-5 overall.
"I felt kind of funny the whole game," Gray said. "It was my mechanics that were off and I just did a bunch of different things to tweak it and get back. The whole game was a grind and I just had to find a way to win."
There wasn't a bigger grind than the sixth inning, when Gray stared at a bases loaded, one-out jam and worked out with a punch out and roller to second.
"I thought the sequence in which he located the fastball and the breaking ball to those two hitters was the best he had all night," said OU head coach Sunny Golloway. "And he did it with bases loaded and one out. He had it in him and it was mental toughness that pulled him out."
The bullpen finished it out, throwing 2 2/3 innings of shutout ball.
First baseman Matt Oberste, whose 30 game hitting streak ended in the contest, put OU on top 1-0 in the top of the first with a sacrifice fly.
Texas tied it in the third courtesy of a passed ball and run-scoring wild pitch.
The Sooners retook the lead with the decisive run in the top of the sixth when catcher Anthony Hermelyn slapped an RBI single up the middle.