Ronaldo poked in Sergio Ramos' header at the far post after four minutes played to break the old record before adding to the tally with an impressive strike in the 77th minute at the Bernabeu.
Ronaldo shared the previous "Pichichi" mark of 38 with Athletic Bilbao's Telmo Zarra and Real's Hugo Sanchez, the league scoring leaders from the 1950/51 and 1989/90 seasons. Spanish league play began in 1929.
"To score so many goals in a season is very hard. I have to thank my teammates," Ronaldo said. "The Pichichi is for them and the fans too."
Ronaldo danced with his teammates in celebration after netting the record-breaking goal as Real coach Jose Mourinho smiled on the bench. The Portugal winger's second took his season tally to 53 in all competitions, including 11 in the last four games.
Messi was left out of the squad for Barcelona's 3-1 league win over Malaga, but can add to his tally of 52 next Saturday when Barcelona play Manchester United in the Champions League final on Saturday.
Ronaldo has scored 86 goals in two seasons with Real, who finished runners-up to Barcelona for the third straight year. Real, however, did beat their biggest rivals to win the Copa del Rey thanks to one of Ronaldo's goals in extra time of the final.
"It's good to finish the season in the best manner possible," Ronaldo said.