When Lord Shiv came out he got carried away in the beauty of Lord Vishnu's female form. Before the seed (shivankur) of Shiv fell on the ground Vishnu took it in his hands because if it fell on ground then all the water on earth would dry and there would be devastation (pralay) on earth. As the seed and its energy came out it had to be kept in a womb and so Lord Vishnu told Narad to go at Siddh Mountain where Anjani was doing penance and with the help of bamboo blow this seed in her ear after this only Ahilya's curse would come true and a soul would take birth which will do good to humanity. Bamboo used to be hollow from both the side during that time. Narad kept the seed of Shiv in it and reached Chandrabani. There he told Anjani who was doing penance underground "daughter, I Narad son of Brahma am happy with you and want to give you knowledge". Looking at the vow taken by Anjani, Narad inserted a bamboo in the ground so that she can fulfill his work by bringing her ear near the bamboo.
Source : http://rootshunt.com/gautam.htm