When Lord Ram was a child, then he one night saw the moon in the sky. He started crying because he wanted to get the moon. King Dashrath, the queens and the servants tried a lot to calm him down but he kept on asking for the moon.
Then guru Vashishth came there. Everybody looked at Vashishth with hope that he would have some solution. Vashishth said that a container filled with water be brought. His order was immediately followed. The moon's reflection could be seen in the water. Guru Vashishth showed the reflection to Lord Ram. Lord Ram was thrilled and he said "chandra", meaning moon. The word chandra was added to his name Rama to make it Ramachandra.