In a way, it should come as no surprise that, nine months after her only child was stricken with an inexplicable, life-threatening illness and her husband of nearly 40 years fell dead at the dinner table, Joan Didion would sit down and begin writing the book that became "The Year of Magical Thinking."

She's been writing since she was 5 years old.

What else would she do?

She began Oct. 4, 2004. She wasn't thinking about a book at first, but a week or so in she found herself working out how one might be structured. The best way, she thought, would be to come back over and over again to certain key scenes, foregrounding different details each time, evoking the obsessive nature of her grief.

Didion never writes from outlines. Sometimes she thinks as much as 30 pages ahead, but in this case, she didn't even do that. She knew the book would end a year after her husband's death. She sensed that an especially intense crisis in her daughter's illness would form a "movement" that should fall a certain distance into the narrative. Otherwise she didn't plan it out. She just wrote.

Her husband, John Gregory Dunne, was a writer as well. Over the years, he had drilled into her the need to include a so-called billboard section: a short passage, early in your story, that tells readers what you're writing about. At the beginning of Didion's career, she had sometimes neglected to do this.

On that first writing day, when she got to the place where the billboard should fall, she typed one in.

This was her effort, she explained, to make sense of the disorienting months after her husband died and their daughter fell ill, a period "that cut loose any fixed idea I had ever had about death, about illness, about probability and luck, about good fortune and bad, about marriage and children and memory, about grief, about the ways in which people do and do not deal with the fact that life ends, about the shallowness of sanity, about life itself."

It was a classic billboard, a billboard to make John proud -- but it didn't stop there. It went on to signal a dramatic change in Didion's writing style.

"As a writer, even as a child," she continued, "I developed a sense that meaning itself was resident in the rhythms of words and sentences and paragraphs, a technique for withholding whatever it was I thought or believed behind an increasingly impenetrable polish."

Then her world changed.

Polished language wasn't enough anymore.

You can almost hear her stepping out from the shadow of those rhythmic sentences:

"This is a case in which I need more than words to find the meaning. This is a case in which I need whatever it is I think or believe to be penetrable, if only for myself."

'Without Being Personal'

She greets you at the door of her Upper East Side apartment, a tiny, pink-sweatered woman of 70 who can't weigh much more than her age. "She doesn't look like she works on the docks" is how her friend Calvin Trillin describes her.

Framed photographs, many of John and their daughter, Quintana, fill flat surfaces in the living room. Neatly squared-off stacks of books lie on the coffee table. One is topped by "The High Sierra," another by "Shadowchild: A Meditation on Love and Loss."

Quintana died in August, after Didion had finished her book. "Many people have said to me: You don't have to promote this," she says, yet "if I didn't do it, it still wouldn't bring her back." She will be in Washington for a reading at the Folger Shakespeare Library at 8 p.m. Friday.

Didion grew up in Sacramento, in California's Central Valley, where her father invested in real estate. Writing started with her mother, she says, "who had been a librarian and had me read a lot." This was before she was in school. "When I was bored or something, when I would whine, she gave me a notebook and said, 'Why not write something?' "

Hers was not a family that encouraged displays of emotion. "This calls for a drink," her father would say whenever such a thing was threatened. Her mother dealt with emotionally charged phone conversations by hanging up. Earlier this month, when her brother handed her a handkerchief at Quintana's memorial service, she began to cry harder than she had before.

"Because it was so sweet, you know?" she says. "We don't usually hand each other handkerchiefs."

Small wonder that she turned into the kind of writer who layered emotional content behind highly burnished prose. In her family, she says, it was "a very daring act" to write publicly at all.

Her first book was "Run River," a California novel she started while working at Vogue, in New York, because she was homesick. More novels would follow, among them "Play It as It Lays" and "A Book of Common Prayer." But it was her early nonfiction, written for a variety of publications and collected in "Slouching Towards Bethlehem" (1968) and "The White Album" (1979), that made her reputation as a clear-eyed, unsentimental observer of cultural upheaval.

"The center was not holding," she wrote, echoing Yeats, to begin the article that gave her first collection its name. "Slouching Towards Bethlehem" made it nearly impossible to romanticize the Summer of Love -- or the '60s in general -- anymore.

It also drew attention to the unusual shape and rhythm of Didion's prose.

"I've been trying for four decades to figure out why her sentences are better than mine or yours," critic John Leonard wrote recently. The answer is "something about cadence. They come at you, if not from ambush, then in gnomic haikus, ice-pick laser beams, or waves."

"There are not many writers of nonfiction who get part of the effect by rhythm," Trillin says. In some hard-to-explain way, this also relates to the knack Didion has shown for "being personal without being personal."

An example:

In "The White Album," she quotes from a psychiatric report generated after she suffered an "attack of vertigo and nausea" in the summer of 1968: "Patient's thematic productions on the Thematic Apperception Test emphasize her fundamentally pessimistic, fatalistic, and depressive view of the world around her."

How personal can you get? Except that she goes on to mix in reportage on the Black Panther Party, the Doors and the Manson Family murders, and to suggest that "an attack of vertigo and nausea does not now seem to me an inappropriate response" to the disorienting chaos of the times.

"We are here on this island in the middle of the Pacific in lieu of filing for divorce," is a much-quoted line from another Didion essay, written for Life magazine around the same time. Yet the sentences and paragraphs that follow let you only so far into the threatened marriage, and you never learn what some might consider key emotional facts: that John knew she was writing the piece, edited it, amused Quintana at the Honolulu Zoo while Didion rewrote it, then drove her to the Western Union office so she could send it off.

'The Vortex Effect'

On Dec. 30, 2003, she and John visited Quintana in the hospital, where she lay unconscious, a seeming case of flu having -- as Didion would write in that billboard paragraph -- "exploded into pneumonia and septic shock." They took a cab home. She lit a fire and began to cook. He settled in to read a book about World War I.

She can't remember if that's what he was talking about over dinner, around 9 o'clock, when he suddenly stopped and she looked up to see him slumped in his chair. He had died, at 71, from "a sudden massive coronary event," though she didn't yet know that.

She called for help. Paramedics crashed in and begin their work. Some time later, at the hospital, she heard a social worker reassure the doctor who was about to deliver the bad news.

"It's okay," the social worker said. "She's a pretty cool customer."

"It was the most amazing thing to be told that, to hear that," Didion says, correcting herself for the sake of precision, as she often does, and laughing, a minute later, at the fact that -- while she was certainly not feeling cool -- she also remembers "being glad that he approved of my behavior."

In "The Year of Magical Thinking," she revisits Dec. 30 again and again, adding detail: about talking to one of Quintana's doctors that evening ("We're still not sure which way this is going," he said), about needing to believe that John had died right away (because otherwise, why hadn't she done more to save him?).

And she turns the idea of the cool customer into a running joke, because it stands in such contrast to who, beneath that polished surface, she actually was.

She was a woman, after all, who could not throw out the last of her husband's shoes -- because she thought he would need them when he came back. "I was thinking as small children think," she writes, "as if my thoughts or wishes had the power to reverse the narrative, change the outcome."

Cool customers aren't supposed to say such things out loud.

When Dunne died, Didion was under contract to write a book about the Kobe Bryant case. She dropped it. It no longer interested her, she was feeling too crazy -- and most important, she still had her daughter to worry about.

By spring 2004, Quintana seemed to have won her battle for survival. On March 23 she spoke at her father's memorial service, which Didion had postponed until her daughter was strong enough to come. Two days later, Quintana and her husband flew to Los Angeles. Coming out of the terminal, she collapsed. The next thing her mother knew, she was having emergency neurosurgery, once again near death.

Didion flew west and stayed five weeks. She narrates this harrowing crisis over about 50 pages in the middle of "The Year of Magical Thinking." But there's more than a medical drama going on here. Also woven through these pages -- and through the rest of the book, as well -- is a series of vignettes that add up to a portrait of a marriage.

To see how these work, you need to understand what Didion calls "the vortex effect." By this she means the ever-present danger -- as she drove, for example, the Southern California streets near where she and John and Quintana once lived -- that she could be pulled toward memories too painful to bear.

It's tempting to see the vortex effect as a structural device, a deliberate way to work in chunks of family memoir, but Didion says she never thought of it that way. She was trying to be true to her experience, and at that time, her world was filled with emotional land mines.

She avoided Malibu, her old neighborhood in Brentwood and even a favorite AM radio station, only to be ambushed by the televised image of a bit of coastal highway. This took her back to 1966, when she and John adopted Quintana, brought her home and "placed her bassinet next to the wisteria in the box garden."

Memories kept emerging, recurring. There was that last trip to Paris, on which they skipped the Monets to go to lunch. There was John, rereading first one novel then another, to see how they worked. There were the infrequent times she drove the car while he was in it, and the more frequent times they fought.

And there was the basic yet unredeemable promise of motherhood, made to Quintana that day they first brought her home: that she would always be taken care of, that she would always be all right.

So much emotion, set down so openly: All this, Didion agrees, is far from her normal mode. Was the experience of writing it different as well?

"It didn't feel like writing," she says. "Writing to me is really hard. And I just sort of sat down and wrote this -- or typed it."

Only later did she realize that it was truly written. This happened after an excerpt got copy-edited and she had to "go back and take the copy editing out to get it to sound like me."

Knopf initially printed 45,000 copies of "The Year of Magical Thinking," but the publisher has had to go back to press seven times; 250,000 copies are now in print. The book is just as polished as Didion's early work, says her editor, Shelly Wanger. But it's "much more raw, much more immediate, much more personal."

It does have an antecedent, though.

Didion's previous book, "Where I Was From," is mostly a reported meditation on California, but it has what Didion calls "memoir aspects." This is especially true of the last section, in which she evokes the aftermath of her mother's death, summing up with a line that seems to foreshadow what was to come:

"There is no real way to deal with everything we lose."

'If I Can Write It Down'

No real way but one, perhaps.

"You think: If I can write it down, I can keep it," Didion says. She's had this feeling more strongly about some books than others. Her first, for one, because she was writing to "re-create home." Her latest, for another.

"I had it very strongly about this book: that I could keep John."

Not surprisingly, she found it hard to end. The problem is there's no resolution: "The conventional way to end something like this is you come to a resolution, right?"

It would be easier if she had faith. But Didion, though she was raised Episcopalian, lacks it.

"To have faith, you have to believe in the face of all evidence to the contrary," she explains. "That has to be the beauty of it and the point of it, but it's a very hard place to reach." She can see the attraction, but has never quite gotten there.

As a child, she was troubled by this. Then she discovered meaning in geology, in "the constant changing of the earth, the unending erosion of the shores and mountains," as she writes near the end of the book. Later, she came to attach equal meaning to "the repeated rituals of domestic life" -- and to the people, of course, with whom those rituals were shared.

This can work. But lose those people, and you're back to square one. Or as Didion writes -- sounding every bit as pessimistic and fatalistic as she was judged to be in 1969 -- you're up against "the void, the very opposite of meaning," and must "confront the experience of meaninglessness itself."

She's done that.

The craziness is gone now; she knows her family isn't coming back.

Still, she hasn't discarded her husband's shoes.

She finished "The Year of Magical Thinking" on Dec. 31, 2004, then saw that the ending she'd come up with didn't work. "I had attempted a resolution, but it was false," she says. She spent a week rewriting.

The new ending has to do with a cave on the California coast, into which she and John used to swim when the tide was right, and with something he taught her there. The meaning in those rhythmic sentences comes through quite clearly -- she is withholding nothing here -- but it can't be summarized.

It remains bound up in the sentences themselves.

"This is a case in which I need more than words to find the meaning," says Joan Didion of her writing after the death of her husband, John Gregory Dunne. "It didn't feel like writing," Joan Didion says of "The Year of Magical Thinking." "Writing to me is really hard."