CORVALLIS, Ore. (AP) Kevin Hogan, a game-time decision because of an ankle sprain, threw for 163 yards and two touchdowns as No. 21 Stanford beat Oregon State 42-24 on Friday night.

Christian McCaffrey ran for a career-high 206 yards for Stanford (3-1, 2-0 Pac-12), which held just a 21-17 lead at the half over the Beavers (2-2, 0-1) before a pair of third-quarter touchdowns.

Oregon State true freshman Seth Collins hit Jordan Villamin with a 40-yard scoring pass to open the fourth quarter and the Beavers pulled within 35-24, but Stanford answered with Barry Sanders' 65-yard touchdown run and Oregon State couldn't catch up.

More from FoxSports

Collins passed for 275 yards and a touchdown, while rushing for another score. Villamin caught seven passes for 138 yards.

Sanders rushed for 97 yards and two scores for the Cardinal.