Jack O'Lantern
According to Irish legend, Jack the Fool managed to lure the devil into a trap when he tried to take his soul. Only after the devil had promised him that he would not go to hell after his death did Jack release him.
When Jack died years later, he was denied entry into heaven because he had committed so many misdeeds during his lifetime. Because of the pact he had made with the devil, he was also rejected in hell. He was sent back to earth by him, condemned to wander around for eternity. However, the devil was merciful: he gave him glowing coals from hellfire to light his way. Jack put it in a turnip.
In Ireland, it became a custom to put coal in turnips to keep the devil and evil spirits away. Irish immigrants brought this custom to the States, where pumpkins were much more common and replaced turnips.