Ronaldo wasted little time in testing Villarreal's second-choice goalkeeper Andres Fernandez, who reacted well to keep out the Portugal forward's dipping long-range strike.
Fernandez was beaten 12 minutes in, though. Luka Modric's quick free-kick found Bale, who spun free of his marker to arrow a low finish into the bottom-left corner.
Villarreal looked to be mustering a response when Fornals struck wide of Luca's goal on the half hour, but Madrid soon had their second.
Having initially delayed his cross, Marcelo delivered an exquisite ball with the outside of his foot at the second time of asking - Ronaldo rising highest to cushion a brilliant header into the far corner.
Madrid could have extended their advantage prior to the interval, Modric chipping over from close range before Ronaldo failed to capitalise on an error from Fernandez.
Nicola Sansone looked set to pull one back shortly after the restart, but Luca got across sharply to parry the Italian's free-kick wide.
Bale continued to shine at the other end. He started a counter-attack with a wonderful flick into Toni Kroos, whose return pass caught the forward offside on the edge of Villarreal's box.
Luca's inexperience was exposed when Sansone got in behind with a terrific turn, but Sergio Ramos was on hand to head Enes Unal's effort off the line after Ronaldo was withdrawn with an eye on the upcoming trip to Kiev.
Neither Ramos nor Luca could deny Martinez in the 70th minute, however, the winger cutting in from the left to hammer a thunderous strike high into the net just 184 seconds after replacing Unal.
Madrid's luck was out and it was Martinez's fellow substitute Castillejo who snatched the draw when he took advantage of Luca's rush of blood to coolly slot home from a tight angle.