The Brazilian, who has been criticised for his poor showings in recent games, opened the scoring with a magnificent free kick six minutes after halftime and took his tally for the season to 15 goals when he netted with a fine header 16 minutes later.
The biggest cheer of the night, though, was reserved for Argentine teenager Lionel Messi who came on as a second half substitute after over three months out with a broken bone in his left foot.
Barca lead the standings on 46 points from 22 games, three clear of Sevilla, who were held 0-0 by city rivals Real Betis on Saturday, and five ahead of Real Madrid who won 2-1 at relegation-threatened Real Sociedad.
Despite missing their strike duo Pedro Munitis and Nikola Zigic, Racing held their own in the opening exchanges at the Nou Camp and were awarded a penalty after Juliano Belletti leant on Juanjo in the area in the 25th minute.
But Barca keeper Victor Valdes produced a great save to deny Argentine spot kick specialist Ezequiel Garay.
Barca stepped up a gear after the early scare, breaking the deadlock six minutes into the second half when Ronaldinho sent a 25-metre free kick curling over the wall and then dipping low inside the post.
The Brazilian added a second when he nodded in from close range after Deco had whipped another free kick into the area from wide on the left in the 67th minute.
LOST GROUND
Fourth-placed Valencia lost ground on the leaders when they fell victim to Bernd Schuster's Getafe who continued their impressive start to the year with a 3-0 win at the Coliseo.
Getafe, who also beat Valencia in the Cup last month, took the lead 30 seconds after the break when skipper Mario Cotelo rifled home at the near post.
In-form striker Daniel Guiza notched up his seventh goal of the season soon after and midfielder Nacho lashed home late on to complete an emphatic win that pushed Getafe up into seventh spot, four points behind Valencia.
Atletico Madrid joined Valencia on 39 points after a classy individual goal from Argentine teenager Sergio Aguero earned them a 1-0 win at home to struggling Athletic Bilbao.
At the other end of the table, Celta Vigo coach Fernando Vazquez could find his job on the line after his side slipped into the relegation zone following a 2-0 defeat at home to Espanyol.
Levante moved out of the drop zone after they followed up last weekend's 1-0 victory at Real Madrid with a 2-1 win over Recreativo Huelva, new signing Salva Ballesta scoring both goals to take his tally to three in two games.
More from rediff