The Champions League winners returned to winning ways after losing twice in the last seven days, despite seeing Fabio Coentrao sent off early in the second half
Karim Benzema struck the post on 10 minutes but the home side didn't have to wait long for an opener, as James converted Cristiano Ronaldo's pass.
The Ballon d'Or nominee then watched on as Bale doubled Real's lead with a fine free-kick in the 28th minute.
But when Coentrao received a red card following a nasty collision with Jose Canas shortly after half-time, Madrid were forced into an enforced reshuffle.
Thankfully for Carlo Ancelotti's men, Espanyol struggled to make the most of their advantage and substitute Nacho Fernandez, added a third to move the leaders four points clear of Barcelona and Atletico Madrid, who meet on Sunday.
Espanyol started the contest brightly and created two chances inside the first three minutes, Felipe Caicedo scuffing wide after a clever run and Sergio Garcia firing straight at Iker Casillas from 20 yards.
Madrid soon clicked into gear, though, and Benzema went extremely close in the 10th minute, striking the post with a fierce half-volley.
The goal frame failed to save Espanyol a few moments later as the home side took a deserved lead through James, who steered home after receiving Ronaldo's well-placed cut-back.
The Champions League winners continued to dominate after taking the lead and, although Raphael Varane headed a presentable chance wide in the 16th minute, a second goal soon arrived.
Bale stepped up ahead of usual free-kick taker Ronaldo just before the half-hour mark and sent an unstoppable effort in off the right-hand post from 30 yards, leaving goalkeeper Kiko Casilla helpless.
Madrid were not given an ideal start to the second half as Coentrao was controversially dismissed after Canas and the Portugal international had crashed into each other with 53 minutes on the clock.
However, the sending off had little impact and Ronaldo almost netted his side's third shortly after, shooting narrowly wide of the bottom-left corner from the edge of the area.
The capital club did wrap things up eventually, as Nacho - introduced in response to Coentrao's red card - slammed a half-volley past Casilla following Alvaro Arbeloa's dinked cross 14 minutes from time.
Victory sees Madrid provide the response Ancelotti had demanded following the defeats to Valencia and Atletico, while also putting the pressure back on Barca ahead of their showdown with the La Liga champions on Sunday.