The story goes like this. Once there was a demon who used to live in this area. But because of his sheer devotion to Lord Shiva, he was able to make Lord Shiva happy. Seeing his penance, Lord Shiva granted him a boon. The demon Bhasmasura, asked Lord Shiva to grant him the power to burn any being to ashes when he places his hand on their head. Lord Shiva granted him that boon.
Now to test that boon, Bhasmasura started chasing Lord Shiva himself. Lord Shiva after getting agitated of the demon approached Lord Vishnu who came up with a solution. Lord Vishnu transformed himself into a beautiful damsel, named Mohini. Mohini enchanted the demon with her beauty and as a final test for the demon she asked him to participate in a dancing duel with her.
Very cleverly in one of the steps Mohini put her hand on head. Bhasmasura, enchanted by her beauty follows her steps and does the same as Mohini resulting in him turning to ashes. These ashes are said to be the reason of black soil in this area. The two large stone formations of the caves are hence named as Bhairaveshwara Shikhara and the Mohini Shikhara and are composed of solid black, crystalline karst limestone.