For the second game in a row Jose Mourinho courted controversy by dropping captain and goalkeeper Iker Casillas to the bench, but the Spain international was soon in action after Adan was shown a straight red card for bringing down Carlos Vela in the area on six minutes.
Casillas was unable to save Prieto's ensuing spot-kick which cancelled out Karim Benzema's second-minute strike.
Although Prieto grabbed two more for the Basque side, Sami Khedira and Real's leading scorer Ronaldo secured the points to end a run of three games without a win for Mourinho's misfiring side.
The champions move on to 36 points from 18 games, 16 adrift of unbeaten leaders Barcelona who beat city rivals Espanyol 4-0 at the Nou Camp later on Sunday.
Second-placed Atletico Madrid, with 40 points, travel to Real Mallorca in Sunday's late game.
The Bernabeu was buzzing with the news that Adan was in the starting line up at the expense of fan favourite Casillas, behind a patched-up defence shorn of the suspended Sergio Ramos and the injured Pepe, Marcelo and Fabio Coentrao.
Real, with Ronaldo wearing the captain's armband, quickly took the lead when Khedira fed Benzema in the area and the France striker turned to score.
The game had barely settled down when Adan misplaced a pass, raced out to correct his error and brought down Vela for a penalty.
Adan was sent off and Casillas was brought on to chants of "Iker, Iker" from the home fans.
Spain's number one was sent the wrong way from the spot by Xabi Prieto, however, and in a nervous few minutes he almost gave away a second with a poor pass out.
Khedira put Real ahead in the 35th minute, cleverly backheeling Ricardo Carvalho's low shot past Claudio Bravo in a crowded area, but Sociedad levelled again before the break.
Prieto pounced on a deflected pass in the 40th minute and slotted the ball past Casillas, and Khedira volleyed wide of an open goal after Benzema's shot came back off the post.
Sociedad's lack of ambition let Real back into the game after the break, Benzema winning a ball in midfield and playing Ronaldo through to score their third in the 68th minute.
The Portugal international thumped a free kick in off the underside of the bar two minutes later, his 16th goal of the campaign.
Althouth Prieto pulled one back for the visitors with 14 minutes remaining, their challenge faltered when defender Daniel Estrada was also sent off near the end.
Meanwhile, Barcelona coach Tito Vilanova was on the bench after undergoing cancer surgery two weeks ago to watch his side crush Espanyol 4-0 at the Nou Camp, while Mallorca held Atletico Madrid at home.