The quality and consistency of Lucinda Williams’s songbook can lead one to think that somebody leaked her the cheat code for how to beat the songwriting game. At her just-plain-astonishing show Tuesday at the 9:30 Club, Williams’s great tunes — old and new, rocking and bluesy, sad and sadder — came like waves hitting the beach, one after another after another.

Williams, 58, has always been able to turn a few repeated notes into memorable riffs, and even mundane observations — such as “His mama believed in the Pentecost. She got the preacher to say some words,” from the suicide chronicle “Pineola” — sound absolutely profound when she drawls them. And nobody has ever been more at home with misery than Williams. Backed by a three-piece rock outfit, she reprised “Metal Firecracker,” a musically buoyant yet utterly depressing gem about trying to walk away from a relationship with some pride, with a level of resignation familiar only to those who’ve been dumped a lot: “All I ask is don’t tell anybody the secrets that I told you,” she sang over and over.

With guitarist Val McCallum stomping on his tremolo pedal, her reworking of the drug-love anthem “Essence,” ending with a long blues-rock jam, made addiction seem both scary and desirable. Drummer Butch Norton was pounding his kit so hard on the 2007 dirge “Unsuffer Me” that his sticks shattered as if hit by an inside fastball.

Much of the material in the nearly two-hour set came from Williams’s new album, “Blessed.” “Buttercup” found the recently married Williams revealing more backbone than she’s shown in past relationship songs — “Good luck finding your buttercup” she snarled — and as much melodic oomph as ever. The live rendition of the disc’s title song, with its litany of references to mystics and various downtrodden types over a few simple chords, recalled 1960s Dylan. That guy had the songwriting game sussed, too.