The Longhorns forced another fumble by Smith in the fourth. But Texas couldn't capitalize on the turnover when an errant snap sailed past Ash, leading to a 16-yard loss before Anthony Fera missed a 41-yard field goal attempt that would have tied the score at 41-41.
Fera, who transferred from Penn State, missed the first four games with a groin injury. Nick Jordan kicked the first four games and Texas is just 4 of 9 on field goals this season.
Ash, the No. 2-rated passer in the nation behind Smith, was 22 of 29 for 269 yards and one touchdown. He took the blame for the miscue on the snap.
"That was my fault. I let the play clock bleed down too low. I should have caught it," Ash said.
Bergeron scored on runs of 2, 2, 1 and 4 yards. His last score gave Texas a 38-34 lead with 29 seconds left in the third quarter before Smith and Buie marched the Mountaineers right back down the field.
Smith threw touchdown passes of 8 yards to Bailey and 40 yards to Tavon Austin in the first quarter and West Virginia led 21-7 after Buie's first touchdown run.
Texas turned the momentum and awoke the record home crowd of 101,851 when Alex Okafor sacked Smith and Jeffcoat recovered in the end zone to tie the game.
Texas chewed up nine minutes on its first drive of the third quarter, moving to a 38-yard field goal by Fera. But Smith simply worker faster and West Virginia's drives resulted in touchdowns.
Smith's second touchdown pass to Bailey put the Mountaineers up 34-31 and the teams traded the lead two more times before it was all over.
"At the end of the day, it's just game, but it's Texas, too," Austin said. "They've won championships. When I was little, I wanted to play a team like this and when I finally did, I got a win."