General Sternwood is a sickly old man who has hired private detective Philip Marlowe to sort out gambling debts accrued by his wayward daughter, Carmen. The debts are owed to a bookseller, Arthur Geiger. Marlowe agrees to take on the case and also learns, from Sternwood's elder daughter, Vivian Rutledge, that a good friend of Sternwood's, Sean Regan, mysteriously disappeared a month earlier.
Marlowe goes to Geiger's rare book shop and finds his combative assistant, Agnes Louzier, manning the front desk. After a tense interaction with Agnes, Marlowe realizes that the bookshop is a front for an illegal operation. He waits in the bookshop across the street and follows Geiger home. At Geiger's house he hears a gunshot and a woman screaming. He breaks in and finds Geiger's lifeless body, a drugged Carmen Sternwood, and a camera with a missing cartridge. Marlowe drives Carmen home, but when he returns to Geiger's house he discovers the body has disappeared. Later Marlowe learns that the Sternwood's chauffeur, Owen Taylor (who was allegedly in love with Carmen), has been found dead, his car having been driven off a pier.
Vivian comes to Marlowe's office the next morning holding scandalous pictures of Carmen, which she says she received along with a blackmail demand for money. Marlowe returns to Geiger's bookshop to find Geiger's employees packing up to leave. Marlowe follows a car to the home of Joe Brody, a gambler who has blackmailed General Sternwood before. He returns to Geiger's house to find Carmen there. She claims to know nothing about the murder but then insists that Joe Brody killed Geiger. They are interrupted by small-time gangster Eddie Mars, the owner of Geiger's home.
Marlowe follows Vivian to Brody's apartment where he finds Brody, Vivian, and Agnes. Carmen arrives, demanding her photographs, but Marlowe keeps the pictures and sends both Sternwood daughters home. Brody admits to blackmailing both General Sternwood and Vivian, when they are interrupted by a buzz at the door. When Brody answers it, he is suddenly shot dead by an unknown assailant who flees the scene. Marlowe follows the assailant, a man named Carol Lundgren, who was associated with Geiger and mistakenly killed Brody to avenge Geiger's death, not knowing that it was in fact Owen Taylor, the Sternwood's chauffeur, who killed Geiger. The Geiger case is closed, but Marlowe is determined to discover more.
Marlowe goes to Eddie Mars's casino, suspecting that Sean Regan ran off with Mars' wife. Mars is cooperative, but changes the subject and tells Marlowe that Vivian is running up gambling debts. Vivian wins a large wager and wants Marlowe to take her home. One of Mars's henchmen tries to rob Vivian but Marlowe intervenes and knocks him out. On the drive home, Marlowe questions Vivian about the nature of her connection to Mars, telling her that he knows the big win and the attempted robbery were staged to make him think that Mars and Vivian were not in cahoots. Marlowe goes home and finds a flirtatious Carmen Sternwood waiting for him. She tells Marlowe that she did not like Sean Regan and that Mars frequently calls Vivian, confirming Marlowe's suspicion that they are working together. After a failed attempt to seduce Marlowe, she leaves, but not without a fight. The following day Vivian tells Marlowe that he can stop looking for Sean Regan, who has been found in Mexico. She tells Marlowe she is going to Mexico to see him. To emphasize the point that his services are no longer required, Mars has Marlowe beaten up.
Harry Jones, an associate of Brody's who wants to marry Agnes, finds Marlowe and makes an offer from Agnes to reveal the whereabouts of Mars' wife in return for $200. Marlowe goes to meet Jones but finds a killer hired by Mars, Canino, already there attempting to find Agnes himself. The killer poisons Jones after Jones gives a false location. Agnes and Marlowe agree to meet, and she tells him that Eddie Mars' wife has been seen driving to a house behind an auto garage near Realito. Marlowe goes there, where he gets attacked by Canino, losing consciousness.
When Marlowe comes to, he finds himself tied up in a room. Eddie Mars' wife is there, and she has agreed to go along with Eddie Mars' plot of making it look like she ran off with Sean Regan in order to protect her husband's reputation. Vivian then enters the room. Mrs. Mars leaves angrily after Marlowe tells her that Mars is a gangster and a killer. Vivian is frightened for Marlowe's life and frees him, enabling him to retrieve his car and his gun. She distracts Canino, so that Marlowe can shoot him. They drive back to Geiger's house, and Vivian tries to convince Marlowe that she killed Sean Regan, but he doesn't believe her.
At Geiger's house, Marlowe calls Eddie Mars and tells him to meet him there. When Mars arrives, he prepares for an ambush, positioning his men outside the house, but little does he know that Marlowe and Vivian are already there. Marlowe surprises him, holding him at gunpoint and getting him to confess that he has been blackmailing Vivian with the information that Carmen killed Sean Regan. He wounds Mars by shooting him in the arm, thus giving a false signal to Mars's men outside. He chases Mars out of the house, where he is mistakenly ambushed and killed by his own men.
Marlowe calls the police, who arrive to arrest Mars' thugs. Protecting Carmen's reputation, Marlowe tells the cops that Mars is the one who killed Sean Regan. When he hangs up, he tells Vivian to get Carmen psychiatric care.