The Valley of Fear begins with Sherlock Holmes, the famous detective, and Dr. Watson, his comrade and roommate at 221B Baker Street, in mid-conversation. Holmes is puzzling over an encrypted message that he 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 that Douglas of Birlstone is in imminent danger. 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 the two 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 trivial by 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 that surrounds the house. When the group confronts the figure, they discover it is Cecil Barker, and that the object he has taken from the moat is a bag, weighed 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 discovered this same bag using the crook of Watson’s umbrella, and put it back to wait for Barker to retrieve it. 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 struggled, and Baldwin died 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 shifts to 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 Scanlan. Scanlan 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 oppresses 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 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 to use against them. McGinty and several of the others are hanged 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 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!” (319). From this, Holmes deduces that Moriarty, the sender of the note, has succeeded in killing Douglas. Watson and McDonald speculate as to whether or not Moriarty will ever be brought to justice. Holmes assures them that he will capture the Professor, but he needs time in order to do so.