The Valley of Fear begins with Sherlock Holmes, the famous detective, and Dr. Watson, his fellow lodger of 221 b Baker Street, in mid-conversation. Holmes is puzzling over an encrypted message, which he has received from Porlock, an associate of Holmes’ nemesis Professor Moriarty. A second message from Porlock, which was supposed to contain the key to the coded message, soon arrives, stating that he (Porlock) is afraid of Moriarty’s wrath and will not reveal the purpose of his correspondence. Holmes soon deciphers the message regardless, and discovers that it warns of imminent danger for one Douglas of Birlstone. The two are soon visited by MacDonald, a policeman friend of Holmes, who informs them that this same Douglas has been murdered.
Upon inspection of the dead man, it is revealed that he has been killed with a sawed off shotgun, an American weapon. Beside the disfigured body lies a card inscribed “V.V. 341” Other clues in the room include a bloody footprint on the windowsill, a missing dumb-bell, and the fact that the man’s wedding ring is missing. Another clue, discovered soon after, is a bicycle, concealed just outside the house grounds. Interrogation of the house servants reveals little, and after Mrs. Douglas, wife of the murdered man, and Cecil Barker, a friend of the family, are questioned, Holmes reveals to Watson that he believes they are in a conspiracy together.
Although the other detectives on the scene share their own theories, Holmes informs Watson that he believes the case hangs entirely on the missing dumb-bell, the one piece of evidence deemed as trivial to the police force. Holmes announces that he is going to spend the night alone in the room in which Douglas was murdered, taking nothing with him but Watson’s umbrella. The day after Holmes’ vigil, he reveals to the police force investigating Douglas’ murder that he has solved the case, and asks them to join him in a stakeout that night.
During the stakeout, which takes place in the bushes outside of the room in which the crime was committed, Holmes, Watson, and the other detectives witness a man lean out the window and fish something out of the moat which surrounds the house. When the group confronts the figure, they discover him to be Cecil Barker, and that the object he has taken from the moat is a bag, weighted down with the missing dumb-bell. Within the bag is a suit of clothing, boots, and a knife. During his stay in the room, Holmes had discovered this same bag, using the crook of Watson’s umbrella. To the astonishment of the others, Holmes reveals that Douglas is still alive. Upon saying this, a hidden compartment in the room opens, and Douglas himself steps out.
Douglas proceeds to explain that he had been hunted for some time by a man named Baldwin who later attempted to kill him. The two had struggled, and Baldwin had been killed when the shotgun went off in his face. With the assistance of his wife and Barker, Douglas concocted a plan to fake his own death, taking advantage of the fact that Baldwin’s disfigured face would prevent an accurate identification. Douglas explains that there are others who would seek his life, and his apparent death would enable him to shake them off forever. Douglas gives Watson a manuscript, which he says details his past life, and tells of the men who wish him dead. After this, the novel merges into Part II, which deals with Douglas’ life in America.
Part II begins with a man named Jack McMurdo, (whom we later discover is Douglas). McMurdo journeys to Vermissa Valley, a coal mining district in the western United States. McMurdo expresses an extreme hatred of policemen, which attracts the attention of a man named Scanlon, who reveals himself to be a member of the order of the Freemen, a society to which McMurdo also belongs. McMurdo soon joins the local lodge of Freemen, headed up by a cruel, violent man named Boss McGinty. It is revealed that the Freemen of this district go by another name: the Scowrers, a Mafia-like society that oppress the people of Vermissa Valley. McMurdo proves to be just as violent as the rest, and he soon becomes a prominent member of the Scowrers.
The gang continues their reign of terror for some time without being challenged, until they learn that Birdy Edwards, a Pinkerton detective, is on their trail. McMurdo informs the lodge that he knows who Birdy Edwards is, and he lays a plan to capture him. McMurdo lures Edwards to his apartment, where Boss McGinty and several of the other prominent members of the gang are concealed. McMurdo suddenly turns the tables on the Scowrers by revealing that he himself is Birdy Edwards, and that he joined the lodge only to gain information against them. McGinty and several of the others are hung based on McMurdo’s testimony, and the others are sent to prison. Edwards, knowing the vindictive nature of the gang, disappears, eventually ending up in England, where events play out as detailed in Part I.
After Douglas’ remarkable story, Holmes warns the man to remain on his guard, as Moriarty, whom Baldwin had contacted to locate Douglas’ whereabouts, will no doubt attempt to kill Douglas himself. Douglas agrees and goes back into hiding.
Sometime after Douglas flees England, Holmes receives a cryptic message which reads only “Dear me, Mr. Holmes, dear me!” From this, Holmes deduces that Moriarty, the sender of the note, has succeeded in killing Douglas. Watson and McDonald speculate whether or not Moriarty will ever be brought to justice. Holmes assures them that he himself will capture the Professor, but they must “give him time.”