Halloween is actually an abbreviation of a Catholic term: All Hallow's Eve. It precedes the Catholic Holy Day of All Saints Day. This is a day when practising Catholics are required to attend Mass. But the origins of Halloween go back many centuries before Christianity.
The day we observe as Halloween originated in the British Isles among the Celtic peoples. They called it the Feast Of Samhain (pronounced sow-WEN in Gaelic). Samhain was the Celtic ruler of the Underworld. On this night, Samhain would open the gates of the Underworld, and spirits, both good and evil would walk the Earth. It was a night of masques and balefires when anything was possible and nothing was quite as it seemed.
If people had to go out on this night, they wore masques so that if they encountered an evil spirit, it would think that they were one of them and leave them alone. Jack-O-Lanterns were carved and lit to frighten evil spirits away. However, interestingly enough, pumpkins were not used. The pumpkin is a New World vegetable, and the ancient Celts had no knowledge of them. Other gourd type vegetables such as turnips and squash were used.
They also lit balefires and would make sacrifices of animals, and sometimes humans to welcome the return of the dead. This they did by constructing a large, hollow wicker figure. This 'wicker man' (yes, just like the movie) was filled with fruits, vegetables, animals, and occasionally a human, then it was set on fire as an offering to Samhain.
As time passed, and pagan beliefs were replaced by Christian Doctrine, and many of the old Celtic traditions went the way of the dinosaur. Some were turned into days of pure amusement, such as Halloween. Now the masques are used by children to get candy from their neighbours, instead of frightening evil spirits away. The same with Jack-O-Lanterns. Images of Samhain have been replaced by that of the Devil, witches, ghosts, and goblins.