IF you make a wish this Christmas Eve, you will be following in a tradition that dates back thousands of years, and perhaps far longer. The dreams invested in the stars drifting silently above our distant ancestors would not, of course, have involved gifts, stockings or fervent hopes that the turkey might have defrosted by morning. Go back far enough and they wouldn't even have been connected to Christ's birth, whose anniversary wasn't fixed in late December until around 350AD.

Wishing, however, appears to have been integral to the pagan celebrations that predated Christmas in the northern hemisphere. And the most fervent hope of all at this darkest point in the calendar was probably simply that spring, and light, would return.

In these street-lit, centrally heated times, it's hard to imagine how hard life must have been during long, dark months when even candles were scarce commodities and death from flu, starvation or hypothermia was never far away. The heart-felt yearning for light is reflected in the peculiar traditions that continue to be observed, albeit in a slightly different form, on Christmas Eve.

Coming a few days after the winter solstice (which this year fell last night), December 24 isn't a public holiday, yet it contains more magic and portent than any of the festival's 12 official days.

The cattle are lowing

The idea that marvellous things happen on this enchanted night is wonderfully evoked in Thomas Hardy's poem, The Oxen.

“Christmas Eve, and 12 of the clock,

'Now they are all on their knees,'

An elder said as we sat in a flock

By the embers in hearthside ease.”

On any other day of the year, the poem continues, few would entertain the notion that a shed full of cattle might kneel down on the straw in an agrarian echo of the Nativity. But on this particular night, nobody doubts it and if someone invited the poet to witness the scene, “I should go with him in the gloom,/Hoping it might be so.”

Those lines were written in 1915, at a time when fear stalked every fireside and the longing for a miracle – the hope that “it might be so” – must have augmented the desire to believe in magic that descends at this time of year.

An apparent manifestation of the belief that animals take on human characteristics on Christmas Eve continues in Denmark, where it's customary to go for a Christmas Eve walk equipped with treats for the animals you might meet: a throwback (or so it's been speculated) to attempts to appease creatures that might otherwise speak ill of you on that enchanted night.

Troll the ancient Yuletide carol

Almost certainly the precursor to the Christmas tree, the Yule log's origins are pre-medieval and believed to be linked to the sacred role of trees in Nordic paganism. Yule is the name of the winter solstice festivals once held across northern Europe (Jul remains the term for Christmas in Denmark, Norway and Sweden; the Finnish word is Joulu).

The log was cut down on the morning of the winter solstice (or later, on Christmas Eve) and brought into the house, though the fact it's said to have been a whole tree trunk makes me wonder if it was burned in a great hall or communal area rather than individual homes. It's generally agreed that the log was ignited in the evening using a remnant of the previous year's log, and according to some accounts, one end would be pushed into the fire and ceremonially burnt and the remainder fed in over the duration of the festive period. The remnants were then stored to protect the house against lightning and evil spirits, and to light the following year's log. The ashes were thought to have magical and medicinal qualities.

The practice continues north of the Border, where, according the Pagan Federation (Scotland): “We celebrate the rebirth of the sun, often by burning a specially chosen log through the long hours of darkness, kindled from the remains of the previous year's Yule-fire.”

One account of the old ritual holds that on Christmas Eve, the youngest person present would light two candles from the burning Yule log, then everyone would make a wish for the coming year. You might want to close your eyes if following this tradition, since it's said that if the shadows cast by the blazing log appear to be headless, death will come calling in the months to come.

The holly and the ivy

If your mantelpiece is already festooned with holly, ivy and mistletoe, then I'm sorry to dampen the mood but it's supposed to be unlucky to bring greenery into the house until Christmas Eve. Be of good cheer, though: the winter foliage tradition is probably older than Christianity, which means December 24 is an arbitrary date so far as Yuletide spirits are concerned.

At one time, holly was grown near homes in the hope that witches and evil spirits would be trapped in its dense, prickly foliage. The plant – and its festive partner, ivy – were associated with fertility: holly was male, ivy female and the leaves were burnt together at the pagan festival of Beltane, presumably in order to promote fecundity and a bounteous harvest the following year.

During some winter festivals, a young girl clothed in ivy would parade around the village with a holly-clad boy, in order to bring life and fertility to the darkest time of the year.

Blame it on the mistletoe

This parasitical plant remains green after the host tree has become bare and apparently lifeless, which may explain the ancient belief in its magical properties: druids would cut it from oak trees using a golden sickle for use in rituals and medicine.

Legend has it that mistletoe was once a tree in its own right. One story holds that Jesus's cross was made of mistletoe wood and the plant was condemned to become the shrunken, parasitic sprig we know today. In Norse mythology, Baldur – god of the summer sun – was killed by an arrow made from mistletoe, thus ushering winter into the world.

Seasonal spirits

Perhaps inevitably, given the scarcity of daylight and the proximity of death during pre-antibiotic winters, some of the magic associated with this time of year is dark and restless. Spirits were long thought to have walked the Earth on Christmas Eve, as Ebenezer Scrooge discovered to his perturbation. In fact, the tradition of telling ghost stories on that night predated Charles Dickens's A Christmas Carol, though the previously oral custom seems to have boosted by the growth of periodical publication in the 19th century.

Henry James's famous 1898 chiller, The Turn Of The Screw, also opens on Christmas Eve with the telling of strange tales around a hearth, and the medieval historian and author MR James continued the tradition into the 20th century, reading spine-prickling stories aloud each Christmas Eve to friends gathered around the fireside in his rooms in King's College, Cambridge.

Why such tales should be associated with December 24 is open to speculation but their function was guessed at by the American author Keith Lee Morris. Writing about seasonal ghost stories three years ago, he suggested that however spooky the tale, it's “not nearly as horrifying as the events that real life holds in store for us”. Scaring ourselves with fiction is, therefore, a distraction from our anxieties and a way of confronting our demons in a safe and homely environment. Obliquely, therefore, the ghost story acts, once again, as a kind of wish: a hope against hope that the real ghouls of illness, death and grief won't come knocking on our doors.

'Twas the night before Christmas …

Christmas Eve's most popular wandering spirit is, of course, Santa Claus, who on this night has been estimated (presumably by scientists with a lot of time on their hands) to travel some 122 million miles, a feat that is reckoned to require his reindeer to move at around five million miles per hour heaving their not inconsiderable burden, particularly as the jolly old elf is likely to have consumed 150 billion calories worth of mince pies along the way.

The legend of Father Christmas has deep roots and worldwide there are plenty of stories of benevolent figures who go around distributing gifts, particularly to children. My favourite is the Russian legend of Babushka, who was racked with remorse after failing to guide the Three Kings to the place of Christ's birth and now gives gifts to sleeping babies and children in the forlorn hope that one of them will be the baby Jesus, and that she will be forgiven.

I'm not sure of the authenticity of this version of the story, but its emphasis on the human desire for atonement is echoed by Ebenezer Scrooge's yearning for redemption following his Christmas Eve tour of his past sins.

The Spirit Of Christmas Present in Dickens's tale – clothed in green robes and surrounded by holly, ivy and mistletoe – bears a resemblance to the Father Christmas of legend, who himself may have been a throwback to the Green Man, probably a pagan fertility figure celebrated as a harbinger of spring. In parts of the British Isles in the middle of the first millennium, someone dressed up as King Winter would be welcomed into people's homes and offered refreshment in the hope he'd reward his hosts with a mild season.

Today's Santa seems to be an amalgamation of all those characters, the Norse god Odin and St Nicholas, a kindly third-century bishop from Turkey said to have distributed gifts to relieve want and suffering. Most famously, he showered gold coins down the chimney of a poor man in order to save his dowry-less daughters from spinsterhood or prostitution, depending on which version of the story you believe. Whatever the rationale, those coins landed in stockings that were drying by the fire, precursors to the socks today's children hang up on Christmas Eve, to be filled with toys by Santa.

Mr Claus's red suit is often said to originate from a 1930s Coca Cola advert, and while it's possible he'd been depicted in similar dress before then, it seems clear that his nocturnal schedule on December 24 is largely the product of American imagination, since most of the details – from the reindeer-driven sleigh to the chubby gent's propensity for laughter – stem from the poem A Visit From St Nicholas, which was published anonymously in New York's Troy Sentinel in 1823 and later attributed to Clement Clarke Moore (though some claimed it was actually written by Henry Livingston – an American of Scottish-Dutch descent).

“'Twas the night before Christmas,” begins the old rhyme, and Clarke Moore's (or Livingston's) account remains the orthodox version of the events that will fill children's heads this Monday night as they lie awake, convincing themselves they can hear reindeer hooves and imagining the wonders they'll find beneath the tree in the morning.

Peace on Earth

Far from Hardy's hearth, the Western Front would have been saturated with yearning. As December 25 approached, young men on both sides of No Man's Land must have wished desperately to be at home with their loved ones instead of huddled in freezing trenches, waiting anxiously for the orders that might catapult them them towards horror and death.

The previous year, Christmas Eve truces had famously taken place on the night of December 24, 1914, when British, French and German soldiers crossed into No Man's Land to exchange greetings, cigarettes and chocolate. Although this memory has undoubtedly been romanticised, it seems clear that truces did take place, that football matches happened, and that the miracle of peace was delivered by frightened, homesick young men who must have been starkly aware of the nonsensical nature of their situation, knowing that the friendships they'd forged would shortly be obliterated by gunfire.

By the time Christmas Eve, 1915, came around, orders had been dispatched that such behaviour wouldn't be tolerated. A few subversive truces took place, nonetheless, but for the most part, the Front Line would have been a cold and lonely place where the wish to be anywhere but in those godforsaken trenches was profound.

The hopes and fears of all the years

The truth, of course, is that the hands stuffing stockings and wrapping presents will be human and the job of realising the wishes that have been planted in children's heads via slick commercials falls to parents, whose own Christmas Eve hope is often simply that their offering will be greeted by joy, and not disappointment.

The pressure to make dreams come true is ferocious. Even if you don't have young children, there's plenty of scope for self-flagellation in the pursuit of the ultimate feast. (No one wants the unspoken consensus around their table to be that – like the Cratchit family's pudding – theirs is a very small turkey or nut roast.) Then there is the pressure to create the atmosphere of domestic conviviality encountered by the penitent Scrooge in the parlour of his nephew, Fred. (“Wonderful party, wonderful games, wonderful unanimity, won-der-ful happiness!”)

Alternatively, we could all remind ourselves that our distant ancestors' most ardent wishes appear to have revolved around the simple desire, on the darkest of days, for a return of the climatic conditions needed to feed and care for their families and communities.

This coming Monday, there will be plenty of people doing their best to keep the spirit of hope alive across Scotland in hospitals, food banks and homeless shelters. Such organisations will be recipients of the collections gathered in watch-night masses and church services where, as the clock approaches midnight, people will sing carols full of hope.

Those songs have particular resonance for Christians, of course, but they also speak to people of different faiths and none about the desire for light in the darkness, and the wish for kindness to transcend selfishness and greed.

In Frank Capra's It's A Wonderful Life, perhaps the 20th century's most familiar secular expression of that message, the community's triumph over avaricious capitalism is expressed in their Christmas Eve rendition of Hark The Herald Angels Sing.

But the carol that evokes most clearly the universal longing for light is surely the one about the distant town of Bethlehem, above whose “deep and dreamless sleep the silent stars go by”. Its final lines, about “the hopes and fears of all the years”, reminds us of the common thread that unites us with all the inhabitants of different continents and epochs, who have ever gazed in wonder at the night sky.

Think of that as you make your wish this Christmas Eve.