© Getty Images
The three-time Ballon d'Or winner missed a 24th-minute penalty by blazing the ball over the crossbar, but he redeemed himself by slotting home from the spot two minutes before the half-time whistle.
Bruma gave the visitors some hope by scoring an equaliser four minutes into the second half, but Madrid responded when Ronaldo found the back of the net from a corner and Lucas netted to take all three points.
In the first half, Sociedad had to weather a storm of attacks, but goalkeeper Geronimo Rulli managed to keep out chances from Pepe, Ronaldo and Karim Benzema, who was making his 200th league appearance for the Spanish side, inside the first 20 minutes.
© Getty Images
Ronaldo squandered the chance to put the hosts ahead when his penalty sky-rocketed into the stands after Carlos Martinez was penalised when Benzema went down in the box from a slight nudge.
Sociedad breathed a sigh of relief when Ronaldo missed, but the Portugal captain got another chance in the 43rd minute after Yuri Berchiche gave away a penalty after handling in the area.
Ronaldo made no mistake that time and sent his team into the half-time break with a slender lead, but Rafael Benitez's side were given a shock when they returned to the pitch as Bruma scored a wonder goal into the top right corner after picking up a pass from Jonathas.
The home side struggled to keep composed as they gave away needless fouls, but Gareth Bale came close to regaining the lead for Madrid after charging towards the edge of the box before aiming a shot at the bottom left corner; Rulli was able to prevent the ball from getting through.
In the 68th minute, Ronaldo was celebrating his second goal after collecting the ball on the edge of the area from Marcelo's corner and hammering it home, and Benzema came close to getting on the scoresheet minutes later by going one on one with the keeper, but his shot was saved.
The victory was wrapped up by Lucas four minutes from normal time when his strike nestled into the bottom right corner after latching on to a cross from Gareth Bale.
The result has sent Madrid to the top of the table, but they may be at the summit for only a matter of hours as Barcelona are in action tonight.