The Tynecastle clash is one of four all-Premiership ties pulled out by former Manchester United boss Sir Alex Ferguson, who helped conduct the draw at Pittodrie with SFA vice president Alan McRae.
Hibernian, beaten in last year's final, travel to Ross County while Dundee United entertain Kilmarnock and Aberdeen, where Ferguson won the cup four times as a manager, take on Partick Thistle at Firhill.
Rangers, who Fergie played for in the late 1960s, were rewarded for their 3-0 victory over Airdrieonians last week with a trip to fellow-League One side Falkirk.
Fourth round draw:
Falkirk v Rangers
Albion Rovers v Motherwell
Culter or Berwick v Dumbarton
Clyde v Stranraer or Auchinleck
Dundee United v Kilmarnock
Queen of the South v St Mirren
Stenhousemuir or Annan v Fraserburgh
Brechin City v Forfar Athletic
Alloa Athletic v Stirling Albion
Ross County v Hibernian
Dundee v Raith Rovers
St Johnstone v Livingston
Partick Thistle v Aberdeen
Hearts v Celtic
Ayr United v Dunfermline
Inverness v Morton
Ties to be played weekend of Nov 30-Dec 1