On that fateful fourth day of his marriage his young wife did not allow him to sleep. She laid all the ornaments and lots of gold and silver coins in a big heap at the entrance of her husband's palatial room and lighted infinite numbers of lamps all over the place. After all these, she went on telling stories and singing songs so that her husband is not able to sleep.
Thus the young wife saved her husband from the clutches of death. Since then this day of Dhanteras came to be known as the day of "Yamadeepdaan" and lamps are kept burning throughout the night in remembering Yam, the god of Death.
Thirteen lamps made of wheat flour and lit with oil are placed outside the house, facing southwards (direction of Lord Yama), in the evening. A lamp is never kept facing southwards except on this day. Then, reciting the following mantra one should offer obeisance: "I offer these thirteen lamps to the son (Lord Yama) of the Sun deity (Surya), so that He liberates me from the clutches of death and bestows His blessings."