According to Irish legend, a long time ago there lived a miser named Stingy Jack. One Halloween, Jack invited the Devil to have a drink with him. He also persuaded the Devil to change himself into a gold coin to pay the innkeeper. But, as soon as the Devil did so Jack popped the coin into his pocket. Because Jack had a silver cross in the same pocket, the Devil could not change himself back, since the cross robbed him of his evil powers. Jack made the Devil promise never to claim his soul before he finally let him go.
After a long and sinful life, Jack died. He was turned back from the gates of Heaven, and made his way to Hell. But he couldn't enter hell either because of the Devil's promise to him. The Devil angrily threw a glowing coal at Jack, who quickly hollowed out a turnip and put the coal inside to light his way. Jack has been wandering through the darkness as a lost soul ever since, holding his lantern before him.
The legend of Stingy Jack spread to England and Scotland, where people believed that a lit jack-o'-lantern protected them from Jack and the other restless spirits that roamed the earth on Halloween. Grotesque faces were carved on the hollow turnips to frighten the spirits away, and each house had its glowing jack-o'-lantern by the front door on Halloween night.
When Irish and Scotch immigrants came to America in the 1800s, they brought the traditions of Halloween with them. They discovered that pumpkins made perfect jack-o'-lanterns, and began to use them instead of turnips. The tradition spread throughout the country and has lasted to this day.