The La Liga giants will visit Ibrox on Sunday, July 25 as Steven Gerrard's side complete their pre-season schedule against the 13-times European champions ahead of the start of their Scottish Premiership title defence the following weekend.
Rangers are the first major European club to reach the 150-year milestone and Carlo Ancelotti's star-studded squad will head to Glasgow as part of the celebrations.
Real Madrid have only visited Ibrox once before – the previous meeting coming in season 1963-64 in the first round of the European Cup which ended in a 1-0 loss with Ferenc Puskas netting the winner.
A Rangers statement read: "This meeting is sure to be a superb occasion, and a fantastic test for Steven Gerrard’s side ahead of the UEFA Champions League qualifiers as two of European football’s most famous names go head to head.
"Ticketing information will be communicated in due course, and RangersTV will be the only place broadcasting the match.”
The match will kick-off at 6pm and comes 24 hours after Brighton and Hove Albion visit Ibrox in another friendly fixture on Saturday, July 24.
The Gers pre-season schedule also includes fixtures against Tranmere away this coming Saturday, Arsenal at home on July 17 and Blackpool away on July 21, before the visit of Brighton and Madrid ahead of the opening Premiership fixture of the new season, and last season’s title flag unfurling, against Livingston at Ibrox on July 31.