Bilel Mohsni grabbed the opener when he swivelled inside the box and fired past David Hutton at the near post before Lewis Macleod executed a perfect bicycle kick to double Rangers’ lead from a corner.
The win leaves the Gers eight points clear of closest challenges Dunfermline in the league.
Ayr were unfortunate not to score themselves when Michael Donald’s early looped effort struck the post before bouncing straight into the grateful gloves of Cammy Bell.
Richard Foster had been rated doubtful with an Achilles problem but was able to start the match for Rangers.
As such, boss Ally McCoist was able to name the same side who romped to an 8-0 win over Stenhousemuir last week.
However, it was clear from the outset that the Glasgow giants would have to work harder for these three points.
Foster was at fault in the opening minutes when Michael Moffat was able to pick out Donald with a cross from the left and his effort cracked off the inside of the post.
The home fans celebrated what they thought was an early opener but the shot failed to cross the line before being claimed by Bell, as Rangers breathed a sigh of relief.
At the other end, Nicky Law tried his luck with a half-volley from the edge of the box but Hutton was untroubled in the Ayr goal as the attempt dipped over the crossbar.
The home side were threatening again when a well-struck free-kick from Scott McLaughlin forced a decent save from Bell, who just managed to tip over at full stretch.
Mohsni picked up the first booking for a challenge on Donald, who had embarked on an impressive surging run on the counter attack, but Bell was able to block the resulting free-kick from McLaughlin.
The yellow cards were quickly evened up when Mark Roberts was cautioned for a foul on Arnold Peralta, with Rangers also failing to capitalise on the set-piece, as Mohsni drifted offside at Ian Black's free-kick.
The visitors should have been ahead on the stroke of half-time when Peralta whipped a corner into the box and Jon Daly somehow flicked past the post with the gaping net at his mercy.
The breakthrough came 10 minutes after the restart when Black's free-kick was chested down by Andy Little for Mohsni, who turned and lashed a lovely effort into the back of the net from 15 yards.
Rangers doubled their lead three minutes later with another impressive goal.
A Peralta corner was won in the air by Mohsni, who nodded into the path of Macleod to send an excellent overhead kick in off the crossbar and over the line.
The Light Blues should have claimed their third of the day when Law's shot was blocked and Lee Wallace drove the rebound over the bar when it looked easier to find the target.
- Sports & Recreation
- Bilel Mohsni
- Michael Donald
- Cammy Bell