There have been three major film versions of the book. All three departed substantially from the text, and introduced a love interest which was not in the original novel. For the films the title is often abbreviated to The 39 Steps, but the full title is more commonly used for the book.
The 1935 black and white version was directed by Alfred Hitchcock, and starred Robert Donat as Hannay and Madeleine Carroll as the woman he meets on the train. It is still regarded as the superior version. In addition to The 39 Steps, Hitchcock directed a number of movies based upon the idea of an "innocent man on the run," including Saboteur and North by Northwest. Scholars of his movies regard this film as one of his best variations upon this particular theme.
The 1978 version was directed by Don Sharp and starred Robert Powell as Hannay, Karen Dotrice as Alex, and a host of other well-known British actors in smaller parts. It is generally regarded as the closest to the book, but still bears little resemblance to Buchan's original story.
Richard Hannay, the protagonist and narrator, an expatriated Scot, returns from a long stay in South Africa to his new home, a flat in London. One night he is buttonholed by a stranger, a well-travelled American, who claims to be in fear for his life. The man appears to know of an anarchist plot to destabilise Europe, beginning with a plan to assassinate the Greek Premier, Karolides, during his forthcoming visit to London. He reveals his name to be Franklin P. Scudder. Hannay lets Scudder hide in his flat, and returns later the next day to find that another man has been found shot dead in the same building, apparently a suicide. Four days later Hannay returns to find Scudder stabbed to death in his flat.
Hannay fears that the murderers will come for him next, but cannot ask the police for help because he is most likely suspect for the murders. Not only does he want to avoid imprisonment, but he also feels a duty to take up Scudder's cause and save Karolides from the assassination, planned in three weeks' time. He decides to go into hiding in Scotland and then to contact the authorities at the last minute. In order to escape from his flat unseen, he bribes the milkman to lend him his uniform and exits wearing it. Carrying Scudder's pocket-book, he catches a train to Scotland.
Arriving at the coutryside somewhere near Galloway, Hannay lodges in a shepherd's cottage. The next morning he reads in a newspaper that the police are looking for him in Scotland. He boards a local train and jumps off between stations. He is seen but escapes, finding an inn where he stays the night. He tells the innkeeper a modified version of his story, and the man is persuaded to shelter him. While staying at the inn, Hannay cracks the substitution cipher used in Scudder's pocket-book. The next day two men arrive at the inn looking for Hannay, but the innkeeper sends them away. When they return later, Hannay steals their car and escapes.
On his way, Hannay reflects on what he has learnt from Scudder's notes. They contradict the story that Scudder first told to him, and mention an enemy group called the 'Black Stone' and the mysterious 'Thirty-Nine Steps'. Britain appears to be in danger of an invasion by Germany and its allies. By this time, Hannay is being pursued by an aeroplane, and a policeman in a remote village has tried to stop him. Trying to avoid an oncoming car, Hannay crashes his own, but the other driver offers to take him home. The man is Sir Harry, a local politician, and when he learns of Hannay's experience of South Africa, he invites him to address a meeting that afternoon. Hannay's speech impresses Sir Harry, and Hannay feels able to trust him with his story. Sir Harry writes an introductory letter about Hannay to a relative in the Foreign Office.
Hannay leaves Sir Harry and tries to hide in the countryside, but is spotted by the aeroplane. Soon he spots a group of men on the ground searching for him. Miraculously, he meets a road mender out on the moor, and swaps places with him, sending the workman home. His disguise fools his pursuers, who pass him by. On the same road he meets a rich motorist, whom he recognises from London, and whom he forces to exchange clothes with him and drive him off the moor.
The next day, Hannay manages to stay ahead of the pursuers, and hides in a cottage occupied by an old man. Unfortunately, the man turns out to be one of the enemy, and with his accomplices he imprisons Hannay. Fortunately, the room in which Hannay is locked is full of bomb-making materials, which he uses to break out of the cottage.
A day later, Hannay retrieves his possessions from the helpful roadmender, and catches a train south to meet Sir Harry's relative at the Foreign Office, Sir Walter, at his home in Berkshire. As they discuss Scudder's notes, Sir Walter receives a phone call to tell him that Karolides has been assassinated.
Sir Walter, now at his house in London, lets Hannay in on some military secrets before releasing him to go home. Hannay is unable to shake off his sense of involvement in important events, and returns to Sir Walter's house. He is just in time to see a man, whom he recognises as one of his former pursuers in Scotland, leaving the house. Hannay warns Sir Walter that the man has been spying, and they realise that he is about to return to Europe with his stolen information. At that point Hannay realises that the phrase "the thirty-nine steps" could refer to the landing-point in England from which the spy is about to set sail. Throughout the night Hannay and Britain's military leaders try to work out the meaning of the mysterious phrase.
Warning: Wikipedia contains spoilers
After some reasoning worthy of Sherlock Holmes, and with the help of a knowledgeable coastguard, the group decide on a coastal town in Kent. They find a path down from the cliff that has thirty-nine steps. Just offshore they see a yacht. Posing as fishermen, some of the party visit the yacht, the Ariadne, and find that at least one of the crew appears to be German. The only people onshore are playing golf by a villa and appear to be English, but they match Scudder's description of the conspirators. Hannay, alone, confronts the men at the villa. After a struggle, two of the men are captured while the third flees to the yacht, which meanwhile has been seized by the British authorities. The plot is thwarted, and Britain enters the First World War having kept its military secrets from the enemy.