John Watson, an ex-army doctor injured in the war in Afghanistan, meets Sherlock Holmes through a mutual friend. They become flatmates, sharing rooms at 221B Baker Street owned by landlady Mrs. Hudson.
There have been a strange series of deaths, supposed by Inspector Lestrade to be serial suicides. Sherlock looks at the latest crime scene, which is of a woman wearing pink. Sherlock deduces that the woman is a serial adulterer with an unhappy marriage. Unlike other victims, she left a note, clawing "Rache" into the floor. Sherlock ignores the suggestion of the forensic expert, Anderson, that it is the German word for revenge and settles on "Rachel", deeming that the victim died before finishing the scrawl.
Sherlock finds splashes of mud on the woman's leg, thrown up by the wheel of a suitcase, and deduces that she is from out of town. The police found no suitcase on the premises, but Sherlock searches for it, later finding it in a nearby skip.
Meanwhile, John receives a call from a public phone and is taken to an empty warehouse. There, he meets a man who claims to be Sherlock's "arch-enemy". The man offers money in return for information about Sherlock's activities, but John refuses.
When John returns to 221B, Sherlock asks him to send a text message to the phone of the fourth victim. At a local restaurant, Sherlock notices a cab and gives chase, using his extensive knowledge of London's streets and alleys to outpace it on foot. However, when he and John catch up with the cab, they find that the passenger is a newly arrived American: a perfect alibi.
Suspecting that Sherlock had withheld evidence, Scotland Yard executes a drug bust on his apartment so that they can search it. Sherlock guesses that "Rachel" was the victim's mail address password and that the victim had planted her mobile phone on the murderer so that he could be traced by GPS. At the same time that John finds that the signal is coming from 221B, Mrs. Hudson tells Sherlock that there is a cabbie waiting for him downstairs.
Sherlock leaves the apartment and enters the cab. The cabbie confesses, but proclaims that he doesn't kill; instead, he speaks to his victims and they kill themselves. He challenges Sherlock to solve his puzzle. They arrive at a school building, and the cabbie pulls out a gun and two bottles. He claims that one contains a harmless pill and the other a poisonous pill. Sherlock realises that the cabbie is dying, and calls his bluff on the gun, which is actually a novelty cigarette lighter. He walks off, but the cabbie challenges him again to choose a pill and see if he can solve the puzzle.
Meanwhile, John has traced the GPS signal from the victim's phone and followed Sherlock. Through a window in the adjacent building, John sees Sherlock about to take one of the pills, and shoots the cabbie. Sherlock questions the dying cabbie, first about whether he got the pill game right, and then about his "fan" that the cabbie had mentioned. Finally, the cabbie reveals a name: "Moriarty".
Outside, Scotland Yard has surrounded the perimeter. Sherlock starts to make some deductions about the shooter before realising it must be John. Sherlock feigns shock to cover for John, telling Lestrade to ignore everything he has just said. Sherlock and John leave the scene but run into the man who had abducted John earlier, who turns out to be Sherlock's elder brother Mycroft. Mycroft instructs his secretary to increase their surveillance status, while Sherlock and John return to Baker Street.