After killing Ravana, Lord Ram had dosha which made him reflect two shadows apart from him being a god.
He started pilgrim to remove his dosha and reached the present place of Mukteshwar and there one shadow disappeared.
After completing the yagya he proceeded forward and reached at the present place of Rameshwar Mahadev.
He arranged for the meals for Brahmins and for the fulfillment of the need for water he used the arrow named Gangasma.
According to the rule before the meals for the worship of Lord Shiva he took sand in his hand from the place he shot arrow and installed Mahadev Linga.