There are a number of mythological tales and legends surrounding Lord Shiva. Here're a few popular ones:
Ganga Comes Down to Earth :
A legend from the Ramayana speaks of King Bhagirath who once meditated before Lord Brahma for a thousand years for the salvation of the souls of his ancestors. Pleased with his devotion Brahma granted him a wish. He requested the Lord to send the river Ganges down to earth from heaven so that she could flow over his ancestors' ashes and wash their curse away and allow them to go to heaven.
Brahma granted his wish but asked him to pray to Shiva, for he alone could support the weight of her descent. Accordingly he prayed to Shiva and he allowed the Ganges to descend on his head, and after meandering through his thick matted locks, the holy river reached the earth. This story is re-enacted by bathing the 'linga'.
The Tiger & the Leaves:
Once a hunter while chasing a deer wandered into a dense forest and found himself on the banks of river Kolidum when he heard the growl of a tiger. To protect himself from the beast he climbed up a tree nearby. The tiger pitched itself on the ground below the tree fostering no intention to leave. The hunter stayed up in the tree all night and to keep himself from falling asleep, he gently plucked one leaf after another from the tree and threw it down.
Under the tree was a Shiva Linga and the tree blessedly turned out to be a bilva tree. Unknowingly the man had pleased the deity with bilva leaves. At sunrise, the hunter looked down to find the tiger gone, and in its place stood Lord Shiva. He prostrated before the Lord and attained salvation from the cycle of birth and death.
Why Shiva is Worshipped in His Phallic Form:
According to another legend, once Brahma and Vishnu, two other deities of the holy Trinity, had an argument as to their supremacy. Brahma being the Creator declared himself to be more revered, while Vishnu, the Preserver, pronounced that he commanded more respect.
Just then a colossal 'lingam', known as Jyotirlinga, blanketed in flames, appeared before them. Both Brahma and Vishnu were awestruck by its rapidly increasing size. They forgot their quarrel and decided to determine its size. Vishnu assuming the form of a boar went to the netherworld and Brahma as a swan flew to the skies. But both of them failed to accomplish the self-assumed tasks. Then, Shiva appeared out of the 'lingam' and stated that he was the progenitor of them both and that henceforth he should be worshiped in his phallic form, the 'lingam', and not in his anthropomorphic form.