The festival of Samhain was celebrated in ancient Irish, or Gaelic culture as the end of the harvest season and a time to put up stores for the winter. Celebrations were scheduled for this festival that marked the end of Summer and observed a time which lore dictated that the line between the world of the dead and the world of the living were blurred.
Bonfires were used to help keep any evil spirits away and light the parties that would go on all night as cattle were slaughtered for meat to see them through the winter. Costumes were used to make sure these spirits couldn't differentiate their own kind from real people, ensuring the safety of mortal souls. Turnips were used to ward of any evil spirits or bad occurrences due to superstitious beliefs, as it was thought that the head of a living thing contained the power and spirit of life. Faces were carved into the turnips and candles sometimes used to light them in accordance with the legend of Stingy Jack, who once trapped the Devil in a tree. Jack paid for his actions by being cursed to roam the world at night with his only source of light being a carved out turnip with a candle inside. Giving birth to the Jack O' Lantern...
During the time of Pope Gregory the fourth, the observance of All Saints Day was moved from the Spring to November first. This day is traditionally observed to celebrate the dead who have had the beatific vision, or have seen and are with God. All Souls Day follows on November the second, celebrating those that have died, yet not attained their place in Heaven.
There are many theories as to why this move was made, the most popular is the belief that the church attempted to usurp pagan celebrations and eventually turn them into Christian times of worship. It was thought that this would eventually lead to the diminishing of pagan belief and practices, replacing it with Christian ethos and ensuring the salvation of future peoples.... A fairly successful plan if you think about it, well, maybe as far as diminishing pagan beliefs. See Christmas and Easter... instead of winter and spring solstice... Let alone the imagery stolen from non Christian religions used to place faces and symbols upon what was considered to be evil. It's a shame that most of these symbols predate Christianity as a whole. The term pagan was originally used as we would use the term "redneck" today. It has morphed over time to include anyone that follows a religious theology or belief structure that does not place the shared God of Christianity, Judaism, and Islam at the head of spiritual thought. (yes, yes.. I know you don't worship no Allah... so don't send me any hate mail, maybe you should read something other than people or penthouse magazine)
With popular beliefs and traditions of Christians, Jews, Muslims, and Pagans mingling world wide, the use of readily available and easier to use items, such as pumpkins instead of turnips, modern media images promoted since the mid 1800's, and the ever present desire to turn a profit, we have thus given birth to Halloween.