There are various legends related to the auspicious festival of Maha Shivratri. These legends are similar in one sense, as they all throw light on the greatness of Lord Shiva and his supremacy over all other Hindu Gods and Goddesses.
One of the most popular legends of Maha Shivratri is related to the marriage of Shiva and Shakti. The day Lord Shiva got married to Parvati is celebrated as Shivratri - the Night of Lord Shiva. It tells us how Lord Shiva got married a second time to Shakti, his divine consort. There is another version of the legend, according to which Goddess Parvati performed tapas and prayers on the auspicious moonless night of Shivratri, for the well being of her husband. Believing in this legend, married women began the custom of praying for the well being of their husbands and sons on Maha Shivratri, while, unmarried women pray for a husband like Shiva, who is considered to be the ideal partner.
There is another very popular Shivratri legend from Puranas, which explains why people stay awake all night on Shivratri and why Lord Shiva is also known as Neelakantha. According to the story, when the battle between devas and asuras took place, a pot of poison came out of the ocean and on the request of gods, Lord Shiva drank the poison. The poison was so potent that it changed the color of His neck to blue. For this reason, Lord Shiva is also called Neelkanth, where 'Neela' means blue and 'Kantha' means neck or throat. As part of the therapy, Lord Shiva was advised to awake during the night. Thus, to keep Shiva awake, the gods performed various dances and played music. Pleased with their devotion, He blessed them all, the next morning. Therefore, Shivratri is the celebration of this event in which Lord Shiva saved the world.
The legend of Shiva Linga is also deeply related to Maha Shivratri. According to the story, Brahma and Vishnu searched hard to discover the Aadi (beginning) and the Antha (end) of Lord Shiva. It has been believed that on the 14th day in the dark fortnight of the month of Phalguna, Shiva first manifested himself in the form of a Linga. Since then, the day is considered to be extremely auspicious and is celebrated as Maha Shivratri - the grand night of Shiva. To celebrate this occasion, devotees of Lord Shiva keeps fast during the day and worship the Lord throughout the night. It is said that worshipping Lord Shiva on Shivratri bestows one with happiness and prosperity.
The legend of Ganga is another popular legend which is related to Shivratri. Ganga's descent from the heavens to the earth has been narrated in the Hindu mythological epic of Ramayana. This legend explains the popular custom of giving bath to Shiv Linga on Shivratri festival. According to this legend, Lord Shiva held out his thick matted hair to catch the river ganga, as she descended from heaven. The meandering through Shiva's lock softened Ganga's journey to the earth and the holy waters washed away the ashes of Bhagirath's ancestors. The Ganga, thus, became an attribute of Shiva and therefore Shiva is also known as Gangadhara. Believing in this legend, Shiva is given a bath with gangajal and devotees take a dip in the holy water of river Ganga, on Shivratri.
Some believe that it was on the auspicious night of Shivaratri that Lord Shiva performed the 'Tandava', the dance of the primal creation, preservation and destruction.