MENTION The Thirty-Nine Steps to anyone of a certain age and they will respond by reminding you of the classic scene in which Robert Donat, as Richard Hannay in Alfred Hitchcock’s masterly 1935 screen adaptation, hangs from the Forth Bridge after his daring escape from The Flying Scotsman. Robert Powell as Hannay dangles precariously from the face of Big Ben in a later version. There are many famous, fondly remembered moments in all three big-screen adaptations but few can be traced to John Buchan's book, proving just how much writers and film directors love to tinker with the source material.

Published in October 1915, the novel is the seminal thriller – much imitated, taut and fast-paced. Set just before the First World War, the story focuses on an innocent man implicated in murder and pursued across England and Scotland by both the police and members of a sinister German spy ring. The security of our islands is at stake. The author’s vivid descriptions of the settings, particularly the moorland country of Dumfries and Galloway, are outstanding, and the way he uses the journey to link landmarks from his own life is outstanding. The Thirty-Nine Steps has long been one of my favourite books, and in its centenary year I am recreating Hannay’s thrilling escapade, with the emphasis on rail travel.

I begin with a coffee in the piazza in front of the BBC's New Broadcasting House in central London. Portland Place, which runs north from here up to Regent’s Park, is the setting for the opening chapter of The Thirty-Nine Steps.

I glance at my watch. I have a train to catch. Peering up at the buildings crowding around New Broadcasting House, I wonder which one contains Hannay’s apartment, where the gruesome discovery of a corpse leads him to make a mad dash to St Pancras. On my way to the station, I spot 76 Portland Place, the site of Buchan’s home between 1912 and 1919, though the original house is long gone.

The noise and steam of St Pancras have also gone and today this Victorian masterpiece is also a gateway to continental Europe. A modern-day Hannay might search the internet for Eurostar services to various destinations across the Channel, but Scotland would still be a safer bet, the use of a passport leaving a trail. Hannay had planned his escape route back at Portland Place, using a map of the British Isles and a copy of Bradshaw's, the essential railway guide.

At the station, he has no time to get a ticket. A porter tells him the platform and as he reaches it he sees the train already setting off. Two station officials attempt to block his way but he dodges them and climbs aboard the last carriage. It seems catching a train was easy in 1914. The manner of Hannay’s departure is exciting but today’s automated ticket gates are intended to deter such extreme measures.

Hannay’s train journey takes him north to Dumfries. He would have travelled on the long-defunct Midland Railway, heading through Leicestershire, Derbyshire and Yorkshire, and across the western Pennines into Scotland. I am following the same route but my journey necessitates several changes, travelling on lines operated by different rail companies. As a result, it takes me about as long to reach Dumfries as it would have taken Hannay.

My first leg is courtesy of East Midland Trains. I change trains at Sheffield, heading for Leeds, a great industrial hub in Buchan’s days of Empire and now a vibrant financial centre. Hannay decides not to risk the restaurant car and gets a luncheon basket instead, sharing it with one of the passengers. I buy a ham and cheese panini while waiting for the Settle to Carlisle train.

The journey takes almost three hours, but beyond Skipton the Yorkshire Dales scenery is never less than spectacular. Almost 140 years old and the last railway to be built by navvies, the Settle to Carlisle main line is the highest in England. Threatened with closure in the late 1980s, this railway is a vital commuter route and a lifeline for many remote communities. One of the line’s highlights is the magnificent Ribblehead Viaduct.

At Carlisle, I change to a ScotRail train for Dumfries. Scotland is where Hannay’s gripping adventure truly begins, gathering momentum amid the hills and glens of Dumfries and Galloway. He criss-crosses the landscape on foot and by train; at one point, it would seem, using the now disused Dumfries to Portpatrick railway. A few miles west of Dumfries I walk the abandoned line from Mossdale to the old halt at Loch Skerrow. The crumbling platforms can still be seen, with the loch glimpsed beyond the heather. "There seemed no road to it from anywhere," wrote Buchan, "and to increase the desolation, the waves of a tarn lapped on their grey granite beach half a mile away."

The spirit of the book is very strong here and the description leaves me in no doubt that Buchan is writing about Loch Skerrow. Accessible only by following the track-bed for about three miles, there is a tangible air of mystery and a strong sense of solitude – a far cry from the frantic pace of Portland Place and St Pancras 350 or so miles away.

North of Mossdale I head for the 17th-century Ken Bridge Hotel, overlooking the scenic Water of Ken on the Dee near New Galloway, believed to be the model for the riverside inn in chapter three of The Thirty-Nine Steps. It is here that Hannay tricks his pursuers and makes off across country in their car.

Now the action moves to the Borders, beyond the M74. The town of Peebles is almost certainly Brattleburn in the book, and the wide green world with glens falling on every side. The Devil’s Beef Tub, near Moffat, is described by Buchan as "a mysterious green chasm". He uses this dramatic landscape as the backdrop to Hannay’s encounters with the Spectacled Roadman and the Bald Archaeologist – the former friend, the latter foe. This is the Scotland of Buchan’s youth, where he roamed the hills and high places, filling his mind with colourful tales of Border raids and Jacobite adventure.

Hannay then heads south, catching the train at Beattock Junction, near Moffat, with two minutes to spare. The station closed in 1972 and I board a trans-Pennine express at Lockerbie, following the west coast main line, part of the Virgin Trains network, south to Carlisle where I transfer to a Pendolino, fast, comfortable and quiet. Hannay would have travelled on trains that had character and names, when they were the pride of the companies that ran them. Crewe station, completed in 1837, is a reminder of that great era of steam.

I arrive at Birmingham New Street just after 4pm. The city is looking to the future. The arrival of the high-speed rail HS2 is intended to reduce the journey between Birmingham and London to 50 minutes. I change to a Cross Country train and follow in Hannay’s tracks to Oxford and then southeast beside the meandering River Thames to Reading’s recently revamped station. From here I head west on a local First Great Western commuter train into a "land of lush water-meadows and slow reedy streams", as Buchan describes rural Berkshire.

I alight at Kintbury, a village beyond Newbury, where the pretty River Kennet runs close to the railway. This is thought to be the model for Artinswell in the book. Here, Hannay meets Sir Walter Bullivant, a spymaster and ally who offers him shelter and reassures him that he is no longer a wanted man. Donnington Priory, near Newbury, now a furniture saleroom, pretty much matches Buchan’s description of Sir Walter’s home. It’s no coincidence. Buchan stayed here as the guest of a fellow Oxford student and his family. The riverside setting is picturesque.

Building to an exciting climax, the story moves to London for a crucial meeting with government figures in Queen Anne’s Gate (Buchan had breakfast with Edward Grey, the Foreign Secretary, at Number 28 in 1914, two days before Britain declared war with Germany), and then on to the Kent coast. The last leg from Artinswell is by road, following the A4 and the A2.

The final chapter is set in the seaside resort of Bradgate – Broadstairs in reality. The plan is to thwart the spy ring’s plans to sail from here with Britain’s vital naval secrets. Their escape route to the beach is an enclosed flight of steps (more than 39) that can still be seen today, leading down to Stone Bay. The inspiration for The Thirty-Nine Steps came when Buchan spent a holiday here in 1914 – the steps and the setting atmospheric and mysterious, then as now.

TRAVEL NOTES

Nick Channer stayed at the Station Hotel, Dumfries (stationhoteldumfries.co.uk) and the Townhead Hotel, Lockerbie (townheadhotel.co.uk).

Further information

The John Buchan Story is located at the Chambers Institution, Peebles. Visit johnbuchanstory.co.uk.

The Thirty-Nine Steps is published by Collins Classics, priced £2.50.