The Brazilian World Player of the Year settled his side's nerves when he scored with a curling free kick on the half hour and then provided a brilliant assist for Ludovic Giuly to add a second soon after the break.
The victory allowed Barca to maintain their advantage over second-placed Real with just six games left to play.
Earlier Real, who beat Barca 4-2 at the Bernabeu last weekend, had heaped pressure on their arch-rivals when a Ronaldo double gave them a 2-0 win at Bernd Schuster's Levante.
The Brazilian grabbed his first by smashing in from six metres shortly before halftime and took his season total to 15 with a superb solo effort in the closing minutes.
Barca are top on 72 points, Real have 66 and Sevilla, who lost 1-0 at home to Osasuna on Saturday, are a distant third on 52, level with Villarreal who drew 0-0 at home to fellow high-flyers Real Betis.
Frank Rijkaard's side poured forward from the first whistle against Getafe but although they peppered the visitors' goal with a succession of shots they had to wait for a set-piece before they were able to take the lead.
Ronaldinho stepped up to take a free kick a metre outside the area and fooled goalkeeper Francisco Sanchez Broto when he curled his shot round the wall and into the corner.
The Getafe keeper did well to stop Barca extending their lead just before the break when he tipped a Giovanni van Bronckhorst shot over the bar but he had little chance of preventing
Ronaldinho unlocked the Getafe defence once more when he slipped a disguised pass into the path of Giuly who then dinked the ball neatly over the keeper and into the net.
SPECTACULAR SAVE
Real were given a tough time by Levante in the opening minutes in Valencia and former player Alberto Rivera was denied a goal by a spectacular one-handed save from Iker Casillas when his shot ballooned off a defender towards the top corner.
Although Levante put together some neat passing moves in the centre of midfield, Real needed just one more opportunity to snatch the lead.
Full back Michel Salgado burst down the right, cut inside to the area and fired in a cross to Ronaldo who pulled away from his marker before swinging a firm right-foot shot past Mora.
Casillas then produced a sharp block to stop a fierce drive from defender Pablo Pinillos and made a brilliant recovery to get his hand to a goal-bound shot from Vladimir Manchev after the Bulgarian striker appeared to have skipped round him at the near post.
Levante had several more scoring chances midway through the second half but Ronaldo who put an end to any hopes of a comeback when he struck again seven minutes from time.
Latching on to a first-time pass from substitute Luis Figo, the Brazilian charged down the centre of the pitch, outpaced defender Jesule, swerved past Mora and guided the ball into the empty net.
At the other end of the table, basement club Numancia were left teetering on the brink of relegation after a crushing 4-1 defeat at Real Zaragoza.