It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that we used to travel with the Prophet (peace and blessings of Allah be upon him). When we ascended to a height, we would say "Allahu Akbar" (Allah is the Greatest), and when we descended into a valley, we would say "Subhan Allah" (Glory be to Allah).