The Longhorns (9-4) never led before Goodwin scored his second touchdown on a deep post pattern, just a down after Texas converted a fourth-and-1 play to keep its chances alive.
Storm Woods ran for 118 yards and scored two touchdowns for Oregon State (9-4). The Beavers left stunned after looking as though they would wrap up their first 10-win season since 2006.
Down 20-10 at halftime, Texas coach Mack Brown said he told his players they would win.
"I told them this it wasn't going to be easy, but I told them this game was ours and we would win it," Brown said. "This one is really special."
The victory was a dose of much-needed good news for Texas after coming into the game under a cloud of questions following the suspensions of backup quarterback Case McCoy and injured linebacker Jordan Hicks.
Ash, whose been pulled at times for McCoy this season, was 21 of 33 for 241 yards. Ash sputtered until the fourth quarter, when he went 9 for 11 for 146 yards. Texas had no choice but to stick with the only backups two redshirt freshmen who haven't taken a snap all season.
Brown announced the suspensions Friday but wouldn't reveal which players were sent home. A person with knowledge of the suspensions told The Associated Press the players were McCoy and Hicks, speaking on condition of anonymity because Texas wasn't releasing the names.
Brown addressed the suspensions during a previously schedule news conference and referred to a local TV report that police were investigating two unidentified Texas players in an alleged sexual assault at a San Antonio hotel. Police released a heavily redacted incident report that only identifies the suspects as two students, one 20 and the other 21.
Authorities are still investigating and no charges have been filed.
Brown said he would not address the suspensions further.
Oregon State quarterback Cody Vaz was 15 of 28 for 194 yards. The Beavers had negative 4 yards in the fourth quarter as they were muffled by the Longhorns defense that was led by Alex Okafor, who finished with 4 1/2 sacks.
Although Goodwin's touchdown catch might have won the game, two spectacular Texas plays in an earlier 83-yard scoring drive handed the Longhorns momentum -- and a chance.
First was wide receiver Jaxon Shipley rescuing a pass sailing behind him with a dazzling one-handed grab at midfield. Ash made up for that off-target throw six plays later, slithering out of safety Anthony Watkins' near-certain sack and flinging the ball to Jonathan Gray, who then zipped down the sideline for a 15-yard scoring play that got the Longhorns to 30-27.
The Longhorns played for a national championship in 2009. What's followed has been the shakiest of Brown's 15 years at Texas: a combined 22-16 record, an overhaul of assistant coaches and stubborn instability at quarterback following seven spoiled years with Heisman Trophy finalists Colt McCoy -- the suspended player's brother -- and Vince Young under center.
A surge of four consecutive victories late this season put this nine-win season in reach -- a benchmark that had been the ho-hum standard of the Brown era. It comes following an unexpected twist earlier this month, when school President Bill Powers went to his blog to write that Brown had his "full support" and would remain the head coach.
Powers cited an increase an "increase in media speculation" about Brown's future. It was published on his blog the same day Brown would not yet commit to Ash or Case McCoy as his starting quarterback for the Alamo Bowl.