With Barcelona winning their league-record 16th straight win on Saturday, the pressure was on Jose Mourinho’s team to keep Barca close.
Madrid responded to the challenge with a convincing performance to stay unbeaten in 11 games at Santiago Bernabeu stadium this season.
Kaka opened the scoring in the eighth minute, placing a left-footed shot into the far corner after Sociedad midfielder Gorka Elustondo had erred in clearing a cross and the ball fell to the Brazil playmaker in the area.
Ronaldo blasted in the second in the 21st, feinting with his right, before crossing to his left and firing in from outside the area and ending his four-game scoring drought.
The Portugal forward then headed home a corner by Mesut Oezil in the 42nd, and Emmanuel Adebayor capped the win in the 89th with his first league goal since joining Madrid on loan from Manchester City.
Real Sociedad got its consolation goal when a shot by Raul Tamudo was blocked by goalkeeper Iker Casillas but rebounded off Alvaro Arbeloa and into the net in the 72nd.