Bournemouth's Ritchie took advantage of hesitation between Denmark captain Daniel Agger and visiting keeper Kasper Schmeichel to slot home after seven minutes.
Denmark, who like Scotland are looking ahead to the World Cup qualifiers after missing out on this year's European Championship, enjoyed the lion's share of possession but were lightweight in attack.
"Our team spirit kept us in it but they (Denmark) were the better side," Scotland manager Gordon Strachan said.
"They should've gone to the European Championship. I've got a couple of young players coming through," added Strachan who handed a full debut to Celtic defender Kieran Tierney.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Scotland won 1-0 in the Czech Republic last week.
(Writing by Martyn Herman, editing by Pritha Sarkar)
