Carson Beck led a 75-yard drive capped by a 3-yard touchdown run with 18 seconds left as Miami edged Ole Miss 31-27 in the Fiesta Bowl to reach its first national championship game since 2001.