Ghosts are in the air again. "Ghost strikes terror into college", last Friday's Times trumpeted. Dons at Peterhouse College, Cambridge, are thinking of asking an exorcist to calm down the spirit of Francis Dawes, who committed suicide in 1789 in connection with some skulduggery over a Mastership election. Dawes's white-hooded form is causing havoc in Combination Room - two butlers have seen him, staff refuse to enter and college life is "severely disrupted".

Cloisters and quads are the natural habitat of ghouls, but that white- hooded form sounds suspiciously familiar - like the Scooby-Doo ghosts who are always the butler in a blanket. Rather old-fashioned, too. Doesn't Dawes know that spooks must be up-to-date?

Each generation invents its own ghosts. In the mid-19th century they abandoned carriages for trains; by the 1930s they were boarding planes and attending cocktail parties; in the 1960s they donned leathers, revved their bikes and became leaders of the pack. Any new technology is a godsend. Today we have donor card ghosts, their souls migrating creepily with their transplanted organs. They flourish in the weird location-free geography of the Net, and in the unchecked capitalism of the Pacific Rim: the writer William Gibson has given us cyberspace spirits in little black cubes, "personality-recordings" of dead Japanese executives, who provide calm corporate advice to kneeling supplicants. Some modern ghosts are less glamorous: in Will Self's story, The North London Book of the Dead, they end up glumly in Crouch End, buying property from dead estate agents. But wherever they are, they keep on coming. "Another dead one, dear Jesus, I do keep on adding to them, don't I?" says John Banville's resigned narrator in Ghosts. "Well, that's life I suppose."

Yet while new spectres flourish, old ghosts never die. Christmas is here and Scrooge is back on television, hoisting Tiny Tim on his shoulders, dishing out the turkey and selling the aftershave. (He's on the Tube, too, in a mock advertisement for Macallan whisky - "Don't be a MacScrooge", when buying your single malt.)

Dickens had a shrewd eye on the Christmas market. Every year he produced a bumper issue of his household magazines, and his prime requirement was a chilling story. But his own A Christmas Carol beat them all, with gleeful self-parody. Watch Scrooge crossing the yard, thinking of nothing, putting his key in the lock, when suddenly he sees in the knocker the face of his long-dead partner: "Marley's face. It was not in impenetrable shadow as the other objects in the yard were, but had a dismal light about it, like a bad lobster in a dark cellar. It was not angry or ferocious, but looked at Scrooge as Marley used to look: with ghostly spectacles turned up on its ghostly forehead. The hair was curiously stirred, as if by breath or hot air; and though the eyes were wide open, they were perfectly motionless. That, and its livid colour, made it horrible...

"Scrooge fell upon his knees, and clasped his hands before his face.

" 'Mercy!' he said. 'Dreadful apparition, why do you trouble me?' "

Nothing, as Dickens knew, reels in readers like a good ghost. Even the words "it was a dark, dark night" are enough to raise the hair on the back of your neck. The great tellers are shameless:

"She was woke up suddenly by a noise that froze the marrer in 'er bones." (WW Jacobs). And the scene can be set in a flash, just by blowing an old whistle: "But what is this? Goodness! what force the wind can get up in a few minutes! What a tremendous gust! There, I knew that window-fastening was no use! Ah - I thought so - both candles out! ..." (MR James)

These stories were meant to be read aloud, by a blazing fire. You can only really enjoy ghosts if you're warm and safe, just as Scream or Halloween seem more fun in a plush cinema with plenty of popcorn and someone to cling to. But why should we want to be scared at all? And why do ghosts have this peculiar, timeless power?

When someone asked Madame du Deffand if she believed in ghosts, she replied: "No, but I am afraid of them." This makes me laugh, but I see its truth. Wherever I am, in a pub, in a school, among friends, among strangers, as soon as I mention ghosts, someone has a "true story" and they all begin: "Well, actually, I don't believe in them, but a friend of mine..." Some are classic tales. You visit a church, hear a door bang and footsteps on the path outside - but no one is there. In the village, people shake their heads and say: "Oh, that's the old vicar, he comes all the time." Or you buy a house where pictures fall off the wall in a certain room, and then learn that a young girl died there. Each county has its own ghostly hitchhikers and mysterious moanings. In Kent, where I live, we talk of the many ghost-induced motorbike accidents on Bluebell Hill. Nearby Pluckley claims to be the most haunted village in England. And on the road between St Margaret's Bay and Dover, one foggy night, a bus driver heard the jangling of a harness and saw the smoky outline of a coach sweep across his path.

The "absolutely true" modern sightings all depend, like traditional stories, on sensible, sceptical narrators. And they still fall into age-old patterns which suggest why ghosts appear. The stagecoach looks back both to the journey of the dead towards the underworld, and to the notion that the devil, or death with his scythe, can whisk us off without warning. The dead young girl and the road crashes express the unacceptable shock of lives that end too soon, or too violently.

Violent death leaves its mark like a stain on the air, great battles most of all. A thousand years ago Pausanias told of horses neighing and men fighting at the Battle of Marathon; the drums of Roundheads and Cavaliers still echo at Edgehill. During the First World War many soldiers saw men in the uniform of earlier ages join them as they went over the top.

But the vision of the stream of the dead can arise without a battlefield.Indeed one of its most vivid summonings is also the most banal, TS Eliot's clerkly swarm in The Waste Land, flooding from suburbia to the office death-in- life.

Here, as so often, the living are ghosts of themselves. Perhaps we believe in ghosts because life is so precious, and so short. Time and space make us small, and ghosts defy them both. They walk through walls, they fly across continents, they link us to the flow of souls across millennia. Yet ghosts terrify as much as they console, because they confront us with our own mortality; they don't like being dead and want to pull the living back underground with them. Maybe that is why so many religions have special days to placate them, like Hallowe'en - to allow them a glimpse of the sun and send them swiftly back.

Belief in ghosts is worldwide and ancient. In the earliest writing, the spirits crowd into the Bronze Age myth of the goddess Ishtar, descending to the place where the dead dwell in darkness, eating dust, clothed with feathers. They are summoned, too, in intimate letters like the one written by an Egyptian wife to her dead husband around 1200BC, begging him to protect their servant girl and their family. "Listen to me!" the widow cries.

"Listen to me!" and "Speak to me!" are constant cries. It is hard to believe that a child, a parent, or a lover has gone for ever and cannot hear us. Many of the great and terrible ghosts of literature are lovers, like Cathy in Wuthering Heights scratching on the glass amid the whirling snow until Heathcliff flings open the window and calls her name: "Come in, come in! ... Cathy do come! Oh! Do once more! Oh! My heart's darling! Hear me this time..." But she is capricious and will not come. Time after time we meet the image of a man or a woman holding out their arms as a faint shape drifts into the dawn. These ghosts are part of grieving. Like the ghosts of Truly, Madly, Deeply they don't go until you learn to cope alone. But normally they do fade: folklore sets their limits - three days, a month, a year and a day - and when the time is up they start to feel uncomfortable. Ghosts in ballads, for example, are full of grumbles:

"The twelvemonth and the day being gone

The ghost began to greet:

'Your salten tears they trickle down,

They wet my winding sheet.' "

Ghosts often long for peace. They clank about in their chains, groaning and moaning, or hover tweedily with a whiff of tobacco, but this is usually because of some unfinished business. Many ghosts are reassuringly practical: a girl's grandfather came to help with her exams, while Chinese ghosts give useful career advice. Others are moral; they return to express remorse or accuse perpetrators of crimes ("Murder will out", as Chaucer's Chanticeleer declares), or they appear to warn the living of their evil ways, as Marley does Scrooge.

Anything buried or lost causes problems. It's as irritating as losing your car keys, or realising there's a half-eaten biscuit somewhere. But sometimes what bothers the spirits is comfortingly mundane. One medieval chronicle tells of a monk who came back to find his cowl because when he had arrived in Paradise Street Benedict ticked him off for being improperly dressed. And RC Finucane, in Appearances of the Dead, describes one of my favourite Victorian spectres, Mr Henry Duty, who appeared unannounced to William White, the new tenant of his cottage:

"Speechless at first, White finally remembered what to do in such situations, intoning 'In the name of the Father, of the Son, and of the Holy Ghost what troublest thou, Mr Duty?' In reply to the ancient adjuration the spirit told Mr White that he had buried some seed potatoes, indicated their location, then vanished."

Now you know what to do. Mind you, there is some risk in asking: "What troublest thou?", as Hamlet discovered. Angry ghosts are tiresome, while vengeful ones bring murder and mayhem. And some just don't know when to go: in Icelandic sagas drowned men keep on turning up at feasts, sitting down at the fire and squeezing water out of their clothes, engaging in mud fights and disturbing the servants.

Yet even these restless spirits offer some hope that death is not the end, a shadowy possibility that leads to seances and spiritualism and sales of ouija boards. Oddly, you don't need faith in a god to accept ghosts, but I think you do have to believe in "souls", which seems to lead us back to the thorny mind-body problem. But it doesn't imply a human consciousness. Ghostly dogs curl up by the fire; owls hoot at moments of doom. And there are even plenty of spectral trains, fiendish wheel-chairs - even malign, ever-bubbling saucepans. And as Ambrose Bierce said, ghosts rarely come naked: they are dressed in their winding-sheets or, like Hamlet's father, "in his habit as he lived". Does this mean that we must believe "that not only have the dead the power to make themselves visible after there is nothing left of them, but that the same power inheres in textile fabrics"? If so, why don't suits of clothes walk abroad without ghosts in them?

It is we who give these dogs and owls and overcoats their ghostly being. And neither our needs nor our wraiths can be exorcised by reason. Indeed the rational 18th-century saw a sudden flurry of knockings and sightings which soon exploded into full-blown Gothic. In our scientific age, poets, novelists and film-makers still explore and exploit the craving for wonders. (I bet ghosts can send e-mails.)

All tales of the dead are stories of the living. They express love and anger, loss and hope, and, however corny they may be, even our modern ghosts let us admit to being scared. In Making Ghostbusters, Harold Ramis says that "bizarre as it was", he wanted his film to say something about life. Finally he found the right symbol, the Stayput Man: "... the whole world of the paranormal seems to represent people's abstract fears - people need a place to put all that nameless dread and so they put it into ghosts and things unseen. But the real source of that dread is in very real things like violence and death and economic uncertainty. So it seemed to me appropriate that when our monster finally appeared, it turned out to be marshmallow - that, literally and figuratively, our biggest fear of the unknown was as insubstantial as marshmallow."

So that's OK then. Just wrap up the gifts, light the candles, put on the video, and let the spooks in. Things that go bump in the night needn't be banished to lonely inns and misty moors - they bring that little something extra to ritual family gatherings. In the words of Jerome K Jerome: "Nothing satisfies us on Christmas Eve but to hear each other tell authentic anecdotes about spectres. It is a genial, festive season, and we love to muse upon graves, and dead bodies, and murder and blood."

Shady business: photographs show shapes that those present cannot recall. From left to right, the Coventry Freeman's Guild dinner (possible ghost ringed), Raynham Hall, Wem town hall and a shot from 1897 PHOTOGRAPHS: FORTEAN PICTURE LIBRARY