The formation of Lord Arunachala in the form of Agni Linga was told to Maharshi Sanaka by Lord Brahma when the Maharshi requested Lord Brahma to tell him about a place whose glory was eternal and chanting of its name itself frees oneself of his sins. Pleased by the inquisition and interest of Maharshi Sanaka, Lord Brahma meditated for a while and started to explain to the Maharshi about the formation and spirituality of Lord Arunachaleswara.
Arunachala mahatmya :
Lord Brahma proceeded, "Myself and Lord Vishnu were born from the Supreme Lord Sadasiva in accordance with His desire". But once, out of our ego and ignorance both of us thought that we were the supreme powers and fought among ourselves to decide who was the best. There occurred a war between us which was destructive to the whole world. Then appeared a limitless column of Effulgence (Agni sthamba) between us. We also heard a eternal voice saying that one of who could discover the limits of the column of Effulgence would be the supreme. Ignorant of the true supremacy both of started to find the limits of the Column in either directions. Lord Vishnu took the form of Mahavaraha, started to dig to find the bottom and I took the shape of Swan, flew to find the top of the Column.
Salutations to the Lord who is praised by all the Vedas and Puranas as the Limitless, Beginingless and Endless. Ignorant of this great fact, Lord Brahma and Lord Vishnu were making streneous and futile efforts to find the limits of the Column of Effulgence. Lord Vishnu in his MahaVaraha form became weak and could no longer proceed further, by the grace of the Supreme Lord was enlightened with the thought that it was his ego which hindered him from remembering the Supremacy of Lord Sadasiva from whom he was born. Then Lord Vishnu meditated Lord Shiva and prąyed Him to forgive him of his ignorance and returned to the surface by the grace of Lord Shiva. The same was the situation of Lord Brahma also became self knowledged by the grace of Lord Shiva and bowed with respect to the Limitless Column of Effulgence.
Then emerged from the Column of effulgence Lord Arunachaleswara with a blessing sign, a Fawn in one hand, axe in another, dark body, a dark spot on the neck and blessed both of them with boons and incarnated in the same place in the form of a Great Hill (Arunachala). This great shrine of Lord Shiva enlightens the devotees of their self and relieves them of ignorance and ego.