The writers who adapted Chandler’s novel for the screen decided they wanted to have Eddie Mars killed rather than leaving him alive and continuing to pose a threat to the General and his two daughters. The final scene is entirely invented by the screen writers, who included the famous William Faulkner. In order to make it plausible that Eddie could be machine-gunned by his own men, who are waiting to kill Marlowe, expecting him to exit Geiger’s house first, the writers called for a thick fog. They also wrote in several mini-scenes in which Mars’s two main thugs are made to look stupid by Marlowe, played by Humphrey Bogart. The whole idea of having Marlowe arrange to meet Mars at Geiger’s house at the end of the film was invented by the screen writers. In Chandler’s novel, Marlowe simply tells Vivian he will go and have a talk with Mars and warn him against using his knowledge of Carmen’s killing Rusty Regan for blackmail purposes. Evidently the screen writers didn’t like leaving loose ends such as that. They didn’t see what Marlowe could say to Mars that would positively silence him indefinitely; and they also probably thought they could make a more interesting cinematic finale out of having Eddie Mars gunned down and permanently disposed of as a threat. However, they didn’t want Marlowe killing Mars the way he had killed Canino. Why not? For one thing, it would seem too repetitious of the shootout with Canino. Also, it might involve Marlowe in a whole lot of interviews with the cops and the D.A. and therefore would not provide the neat closure they wanted for the end of the film.
There are many differences. The homosexual relationship between Geiger and Carol Lundgren is only hinted at. Geiger's business of renting pornographic books is only hinted at. It is not Eddie Mars' wife who releases Marlowe but Vivian Regan, General Sternwood's older daughter (played by Lauren Bacall), who is not even present there in the house behind Art Huck's garage in the book. In the book, Marlowe gets a flat tire by running over some sharp objectes on the road while on his way to Huck's garage. In the film, Bogie deliberately lets the air out of two tires in order to have an excuse for getting into the garage. Marlowe arranges to have Mars killed by his own men in the movie; in the book Mars is still alive at the end, and Marlowe just says he'll go and talk to him in order to warn him against bothering any of the Sternwood family again. The scene in which Marlowe finds Carmen Sternwood naked in his bed does not occur in the movie. They have a scene at Eddie Mars' gambling club in which Vivian sings a song to a large group. The name of the song is probably "And Her Tears Flowed Like Wine." This was inserted just to give Lauren Bacall a chance to sing. In the book there is a scene down by the oil wells in which Carmen tries to shoot Marlowe. I don't believe this was included in the movie, although Bogie tells Bacall about the incident later on. One of the writers who worked on the film adaptation of the novel was the great William Faulkner.