A second half goal from Joe Hamill gave Hearts their first victory at Ibrox since 1996.
Joe Hamill is mobbed by his team-mates at Ibrox
Rangers seldom troubled the well-organised visitors, who were without a number of first-team regulars, including skipper Steven Pressley.
The goal came in the 50th minute when young Rangers full back Alan Hutton made a mess of pass back, allowing Hamill to run in and shoot home.
Hearts had a number of good performers, with Scott Severin in excellent form.
Rangers, who were watched by signing target Alex Rae, presented floral tributes to Frank and Ronald de Boer, Henning Berg and Michael Mols, who will all leave the club in the summer.
The home side had a good chance after seven minutes when Chris Burke was released by a superb lofted pass from Mikel Arteta but the young winger's first time shot bounced wide of Craig Gordon's near post.
Hearts responded immediately when Hutton miscontrolled to allow Hamill a sight of goal from the edge of the box but his shot was wastefully wide.
Hutton redeemed himself on the half-hour when he blocked a Severin header on the goal-line after the midfielder had come charging in to meet a corner from Steven Boyack.
Arteta then came close with a low, curling free kick that had Gordon scrambling to stop the ball from whipping in at the near post.
Mols accepted a Paolo Vanoli pass to motor goalwards but, after cutting in from the left with Andy Webster challenging, sent a drive flashing far beyond the far post.
Five minutes after the interval the vistors were handed a gift when Hutton fluffed his back pass, allowing Hamill to pick up the ball and sweep it past Alan McGregor from 18 yards.
The de Boers, Michael Mols and Henning Berg wave goodbye
Graham Weir then had a great chance to increase the visitors' lead but shot straight at McGregor.
Vanoli claimed he had been impeded in a crowded Hearts box but referee Dougie McDonald was not interested in awarding a penalty.
Rangers pushed men forward in search of an equaliser but Hearts defended stoutly in the closing 20 minutes to repel the home side's advances.
Steven Thompson sent a close range header from an Arteta corner wide before Ronald de Boer finally made his entry in the 79th minute, replacing Mols.
There was a standing ovation for Mols, who was clearly moved, but his fellow countryman was unable to provide a happy ending for the end of season party.
Rangers: McGregor, Hutton, Khizanishvili, Frank de Boer, Vanoli, Ricksen, Arteta, Hughes, Burke, Mols, Thompson. Subs: Robinson, Ronald de Boer, Ross, Lovenkrands, MacKenzie.
Hearts: Gordon, Neilson, Webster, Severin, Kisnorbo, Boyack, MacFarlane, Hartley, Janczyk, Hamill, Weir. Subs: Moilanen, McKenna, Wyness, Simmons, Sloan.
Referee: D McDonald