A rare lung disease killed Elaine Pagels’ 6-year-old son, and then about a year later her husband fell to his death while mountain climbing. After that Job-like run of tragedies, no one would have blamed Pagels if she had decided to “curse God and die.”

But she held on. Through rage and terror and despair so overwhelming that it made her faint, she held on.

“I had to look into that darkness,” she says at the opening of her new memoir, “Why Religion?” “I could not continue to live fully while refusing to recall what happened.”

Pagels acknowledges that “no one escapes terrible loss,” but as the country’s most popular historian of religion, she brings a reservoir of spiritual wisdom to bear on the thousand natural shocks that flesh is heir to. A MacArthur “genius” and a professor at Princeton University, she has long been one of those rare bilingual academics capable of speaking to lay and scholarly readers. Her foundational work, “The Gnostic Gospels” (1979), revolutionized our concept of early Christianity, won a National Book Award and became a best-seller. Her subsequent books, including “Adam, Eve and the Serpent,” “The Origin of Satan” and “Revelations,” have continued to complicate conventional understandings of Christianity and trace the persistence of ancient attitudes in modern society.

Now, at 75, with disdain for “the facile comfort that churches often dole out like Kleenex,” Pagels leads us through the remarkable events of her life by considering the consolations and the tortures of faith. “Why Religion?” is, as its subtitle states, a personal story, but it’s also a wide-ranging work of cultural reflection and a brisk tour of the most exciting religion scholarship over the past 40 years.

Given Pagels’ famously ecumenical approach, it’s surprising to hear that her spiritual journey began at a stadium revival preached by Billy Graham. At 15, vaguely curious, she tagged along with some Christian friends to the Cow Palace outside San Francisco. Her family was ferociously secular, but when Graham invited the assembled crowd of 23,000 people to be born again, Pagels found his invitation irresistible. In tears, she stepped forward to be saved. “That day opened up vast spaces of imagination,” she writes. “It changed my life, as the preacher promised it would — although not entirely as he intended.”

That reference to “imagination” — the first of many laced through this memoir — foreshadows her eventual break from orthodox Christianity, but it also suggests her determination to think creatively about sacred texts and the influence they wield. One of the bedrocks of her philosophy is that “what we imagine is enormously consequential.” While others, like her parents, simply dismissed religion as a chaotic system of fairy tales, Pagels has felt impelled to keep asking, “Why is religion still around in the 21st century?” It’s a question that has sent her searching around the world and across millennia.

But in her 20s, while studying modern dance with Martha Graham, she was interested in many things. With a childlike sense of awe, she applied to five graduate schools in five fields. She never says so (she’s far too modest), but it’s clear she could have excelled in any of them. Harvard University told her it already had too many women in its religion program — why waste openings on the flighty sex? — but if she were still interested a year later, she could apply again. Fortunately, she did, and before long she was working on a “top secret” cache of Egyptian documents discovered in 1945 — heretical gospels long rumored but considered lost in the sands of time. “I was amazed,” she writes, “to find that some of these texts spoke words I’d never heard before yet longed to understand.”

“Why Religion?” — a counterpoint of sorts to Huston Smith’s “Why Religion Matters” (2000) — moves freely among the intimate details of Pagels’ life, her marriage to the brilliant physicist Heinz Pagels and the challenges of upending centuries of calcified belief. Along the way, she describes the terrors of raising a terminally ill child, considers the ethics of futile medical interventions and testifies to the temptation and havoc of denial.

She is consistently, sometimes hilariously humble. She mentions that she started reading Greek the way one of us might mention that we started watching “Unbreakable Kimmy Schmidt.” World-famous acquaintances — Jerry Garcia, Andrei Sakharov, Oprah Winfrey — are noted without a whiff of arrogance. Her controversial professional triumphs and critical discoveries are recounted with head-spinning speed. Indeed, Elaine Pagels’ previous books, which are concise to a fault, are not always well served by being so aggressively summarized in this new book. As she speaks of profound spiritual and religious matters, I pined for a more poetic and contemplative style, something along the order of Marilynne Robinson or Christian Wiman.

But when the memoir arrives at the death of her little boy, Pagels’ tone feels bracingly appropriate. “I can tell only the husk of the story.” It felt, she says, “like being burned alive.” Grasping for some explanation, pricked with the cruel sense that illness is the punishment for sin, she began to search for the source of this self-recrimination. Suddenly, the Bible texts seemed stained with dread:

“Working hard to stay steady, or seem to, I could no longer afford to look through a lens that heaps guilt upon grief,” she writes. “Although I wasn’t a traditional believer and didn’t take such stories literally, somehow their premises had shaped my unconscious assumptions. Now I had to divest myself of the illusion that we deserved what had happened; believing it would have crushed us.”

That unspeakable experience confirmed her understanding of the influence of the Bible’s stories. “Whether we believe them or not, they are transmitted in our cultural DNA, powerfully shaping our attitudes toward work, gender, sexuality and death,” she writes. “I sought to untangle my own responses, while sensing how powerfully our culture shapes them.” One gets the impression that studying herself in the crucible of grief was often the lone activity that kept her sane.

Feeling confused and overwhelmed, she turned to the New Testament, the Gnostic Gospels of the Nag Hammadi Library and Buddhism. In theory and practice, her life demonstrates the freedom that comes from breaching the boundaries of orthodoxy and accepting insight wherever it might be hiding.

Those include mystical places that most academics would be reluctant to enter. But Pagels is as fearless as she is candid. In the depths of her sorrow, she recalls uncanny coincidences, acts of precognition, ghostly visitations and even a confrontation with a demon one night in the hospital. These episodes are never submitted as factual evidence of supernatural intervention. Instead, Pagels offers her subjective experiences to demonstrate the way our lives are molded by ancient stories, consciously and unconsciously.

Still, the facts are as hard as a gravestone: No saint interceded to fill her son’s lungs. No angel caught her husband as he fell from Pyramid Peak. And no ray of divine inspiration eventually illuminates a greater good in their deaths. But that’s not the end of the story for Pagels. With the twinned spirits of seeker and scholar, she kept studying the Gospels, the letters of Paul, the Gnostic texts and the insights of Buddhism and Trappist monks until she understood that suffering is an essential and common element of human life. Toward the end, she writes, “My own experience of the ‘nightmare’ — the agony of feeling isolated, vulnerable and terrified — has shown that only awareness of that sense of interconnection restores equanimity, even joy.”