Ronaldo's four goals took him past Telmo Zarra's mark of 251 that had stood as a record until Messi broke it in 2014.
Besides surpassing Zarra's mark for Athletic Bilbao from 1955, Ronaldo also passed Barcelona's Luis Suarez as the league top scorer for the season. Ronaldo has 27 goals to Suarez's 25.
After Pepe put Madrid ahead before halftime, Ronaldo scored with a long shot. He added another goal from a stunning freekick, tapped in a short cross, and headed home a corner kick.
Jese Rodriguez and Gareth Bale completed the demolition of a Celta side that held its own before halftime but fell apart in the second half.
Madrid remained in third place and a provisional nine points behind Barcelona, which visits Eibar on Sunday, when second-place Atletico Madrid also visits Valencia.
Elsewhere, Las Palmas ended fourth-place Villarreal's 14-round unbeaten streak with a 1-0 away win, Sevilla drew 1-1 at Getafe, and an own goal gave Malaga a 3-3 draw at Deportivo La Coruna.