This seems to be a superstitious practice but it might help the person to realise impermanence or to rid himself/herself of the fear of death.
In Buddhism, death is one of the four Maras and one's practice, in order to attain Buddhahood, is to overcome the four Maras or demons: the Mara of the delusions, the Mara of the contaminated aggregates, the Mara of death, and Devaputra Mara. "All four are called mara (obstacle) because they prevent the attainment of nirvana, the deathless state.” (Asanga, ?r?vakabh?mi). The Mara of death can be defined as "the factor that, due to actions and afflictions, terminates the life faculty against one’s will." This Mara causes the time of death for sentient beings among the types of sentient beings.
Here is what Lama Tsongkhapa said regarding the four Maras:
“The Mara of the afflictions (delusions) does not exist from the eighth stage (bhumi) on. Regarding the Mara of death, death due to actions and afflictions does not occur from the first stage on, but the transmigration (’chi ’pho ba) of mind and body is not overcome until the attainment of Buddhahood. Therefore, the Mara of death and the Mara of the aggregates exist until the attainment of Buddhahood. Since the deity Mara [Devaputra] impedes [the defeat] of the [other] three, it exists as long as those three continue to operate.” (Tsongkhapa, "Golden Rosary").
From the above description, it can be seen that there are the coarse as well as the subtle forms of the Mara of death. How does one destroy the Mara of death on the Hinayana and on the Mahayana paths? According to Tsongkhapa's disciple, Gyaltsab Je, "On the Hinayana path, one destroys the Mara of death when one becomes an arhat who is both fully liberated from the afflictive obstructions and is a master of meditative absorption. ... [On the Mahayana path] the Bodhisattva ... destroys the coarse Mara of death at the eighth stage because he abandons the Mara of death who causes death through coarse exertion." (Gyaltsab Dharma Rinchen, in Donald S. Lopez Jr., "The Heart Sutra Explained")