Barcelona remain just two points behind the league leaders thanks to two assists from Luis Suarez as they came from behind to snap a two-game losing streak in La Liga with a 2-1 win at Almeria yesterday.
Bale took just nine minutes to make his mark as he slid in to turn home Toni Kroos's low cross before Sergio Ramos's fortunate looping effort doubled Madrid's lead.
An awful attempted backpass from James Rodriguez gave Rayo hope just before half-time as Alberto Bueno reduced the arrears, but Kroos restored the hosts' two-goal advantage with his first goal for the club.
A pelvic muscle injury had kept Bale on the sidelines for five games prior to his return as a second-half substitute against Liverpool in midweek, and there were positive signs for Welsh boss Chris Coleman as he looked back to his best ahead of his country's crucial Euro 2016 qualifiers against Belgium and Israel.
Bale was on hand to prod home the opener from close range after a neat one-two between Kroos and Ronaldo as Madrid started brightly.
However, from the resulting corner Ramos made it 2-0 when the ball fortunately ricocheted off his thigh into the top corner.
Rayo were gifted a reward for their neat possession football two minutes before the break, though, as Rodriguez passed the ball straight to Leo Baptistao and the on-loan Atletico Madrid striker squared for Bueno to slot into an empty net.
Baptistao thought he had brought Rayo level 10 minutes into the second period, but the goal was ruled out for a marginal offside call and within seconds Madrid had put the game to bed.
