From www.encyclopedia.com:
The cottony, matlike body, or mycelium, of the fungus develops in the ovaries of the host plant; it eventually turns into a hard pink or purple body, the sclerotium, or ergot, that resembles a grain of rye in shape.

Ergot fungus has a really interesting history. It is believed that ergotamine and its sister alkaloids were the cause of St Anthony's Fire, a condition which often would affect an entire town, causing people to dance in the street, see visions, and just generally act weird, when the towns grain supply had become infected heavily with ergot.

Ergot is also responsible for a syndrome known as ergotism which can kill a person. The most well known symptom of this is the limbs changing color (green or black). This is actually gangrene caused by constricted blood vessels.

LSD was discovered by chemist Albert Hoffman while he was investigating the properties of ergotamine derivitives, specifically for their use in stimulating blood flow. He accidently got some on his hand, and thus a new drug was discovered.

Other ergot derivatives, like ergonovine have been used as medicines in childbirth. In fact, the use of ergot to stop postpartum uterine bleeding dates back to the 17th century.

Ergotamine has also been used to great effect in stopping migraine headaches.