In 2012, Mr. McCarthy wrote a screenplay, “The Counselor,” about a lawyer in the Southwest who falls into the drug business. Ridley Scott adapted it for a film in 2013 starring Michael Fassbender and Cameron Diaz.

Mr. McCarthy was married for a third time, to Jennifer Winkley, in 1998, when he was 64 and she was 32. The marriage ended in divorce in 2006. In addition to his son John, from Mr. McCarthy’s third marriage, he is survived by another son, Chase, from his first marriage; two sisters, Barbara Ann McCooe and Maryellen Jaques; a brother, Dennis; and two grandchildren. His first wife, Ms. Holleman, died in 2009.

Late in 2022, Mr. McCarthy released a pair of ambitious linked novels, “The Passenger” and “Stella Maris,” to mostly adulatory reviews. “The Passenger” is about a racecar driver turned salvage diver named Bobby Western — he somewhat resembles Mr. McCarthy in his taciturnity, his Knoxville childhood and his fondness for New Orleans and its nightlife — who sees things he should not see. Before long he is pursued not only by G-men but, it can seem, also by all the ghosts of the 20th century. It’s a novel of ideas — about mathematics, the nature of knowledge, the importance of fast cars — that slips into pretentiousness at times but also contains flatulence jokes.

The title of the second novel, “Stella Maris,” refers to a psychiatric hospital in Black River Falls, Wis. That is where 20-year-old Alicia Western, a doctoral candidate in mathematics at the University of Chicago, has checked herself in because she’s been hallucinating. Central among her visions is the Thalidomide Kid, a shambolic dwarf with flippers and a bent sense of humor. Alicia is carrying a plastic bag stuffed with $40,000, which she tries to give away to the receptionist. Alicia also happens to be Bobby’s sister. Their father was a physicist on the Manhattan Project.

Shortly before Mr. McCarthy’s death, it was announced that he had been at work on a screenplay for a film adaptation of “Blood Meridian,” to be directed by John Hillcoat, who directed the film of Mr. McCarthy’s “The Road.”