The Shootist (1976)
John Bernard Books, a gunfighter approaching his 58th birthday, finds that he has rectal cancer and two months to live. He takes a room with Bond Rogers and her son, Gillom, to wait until death comes. Of course, his very presence starts off events in the town. The Marshal comes, prepared to die in a shootout, Gillom tries to idolize him, Bond first is disgusted and then pities him. Then, realizing that he will die in great pain, he comes up with an idea to go out with a bang.