Jon Daly opened the scoring at Ibrox with his 18th goal of the season, before Fraser Aird doubled the scoreline in the first half.
Bilel Mohsni then put the gloss on the victory with a late strike to ensure the three points would remain in Glasgow.
The win took place against a backdrop of off-field unrest ahead of the club’s annual general meeting this month.
The majority of the 45,227 crowd participated in a pre-planned ‘Sons of Struth’-organised protest against the current board by holding aloft red cards on the 18th and 72nd minutes.
The AGM on December 19 could result in a number of changes within the Ibrox boardroom, with a group of shareholders seeking election, while calling for the removal of current directors.
But, while uncertainty continues to surround the Ibrox hierarchy, the team on the pitch continued to prove to be unbeatable opposition.
Rangers made one change from the side who thrashed Forfar 6-1 at the same venue midweek.
Arnold Peralta was drafted into the side, while Nicky Law was forced to sit out the match with a groin strain.
Like grounds around the country, a minute of applause took place ahead of kick-off in respect of Nelson Mandela.
The first real chance fell to the home side when Peralta cut back for Daly but his connection was awkward and he fired over.
However, the Irishman was celebrating the opener with just 12 minutes on the clock.
Ian Black delivered a free-kick into the box where Daly was waiting to send a glancing header past goalkeeper David Hutton from six yards.
Lee McCulloch saw his own header flash wide of the upright from a corner as the Light Blues searched for a second goal.
Rangers increased their lead after 23 minutes when Aird embarked on a surging run through the Ayr defence before dispatching an impressive shot into the back of the net.
The home side kept up the pressure and Lee Wallace did well to cut back from the byline for Daly but he was off- target from six yards.
The forward then tried his luck with a lob that he was unable to keep down under pressure from defender Adam Hunter.
Ayr United looked more dangerous after the break and forced a couple of corners early in the second half that they failed to capitalise on.
But it was Rangers who still looked most likely to find the back of the net again and Lewis Macleod was not too far away with a shot from distance that fizzed wide.
Hunter was then cautioned for hauling down Nicky Clark, with the resultant free-kick almost leading to a third goal.
Black flighted the ball into the box where McCulloch was waiting but his header was clawed to safety as Hutton pulled off a great save in the Ayr goal.
But there was no way back for the Honest Men when Mohsni forced home with five minutes to go, after Hutton had again denied McCulloch.