McTeague's marriage to Trina has been deteriorating for some time. After McTeague, or Mac, is debarred from practicing dentistry by the authorities—thanks to his former friend, and Trina's cousin, Marcus—the McTeagues' marriage begins its long, precipitate decline.
For her part, Trina faces up to the grim reality of the family's reduced circumstances by scrimping and saving, stashing away every last penny piece she can get her hands on. But her greedy husband isn't satisfied by this; he wants to continue living in the style to which he's become accustomed, but he can no longer do so because of his huge drop in income. So, he helps himself to all of Trina's savings and abandons her.
It isn't very long before McTeague has squandered the money he stole from Trina and returns home looking for more. Understandably, Trina refuses to give him a single penny. In a fit of rage, Mac beats her to death before stealing her entire hoard of gold.
The stage is now set for the novel's unforgettable ending. When Marcus hears of Trina's murder, he immediately sets out to hunt McTeague down. Eventually, he catches up with him in the burning hot desert of Death Valley, California, one of the hottest places on earth. In their final showdown, Mac and Marcus fight over Mac's remaining water supply as well as Trina's gold. Eventually, Mac prevails in the struggle and kills Marcus. But as Marcus lies dying, he manages to handcuff himself to McTeague. With no water, and no one to help him, McTeague is now all alone in a burning hot desert, shackled to a corpse.
The ending is appropriate because McTeague has been undone by his insatiable greed. It was greed that led him here to this arid, godforsaken place, and it is greed that will guarantee him a slow, agonizing death under the sun. McTeague has got what he wanted: money and lots of it. But it's absolutely no use to him now, as the infinite sands of the burning desert stretch out before him as far as the eye can see.