Karen Iris Tucker is a Brooklyn-based journalist who writes primarily about genetics, health and cultural politics.

It was Halloween night in 1977. A young Robert T. Hoff was dressed as a mummy, having purchased a 30-foot roll of gauze at a fabric store and wrapped himself in it. At a party that evening, he had a fateful fling with a cute redheaded guy that changed the trajectory of his life. Hoff was diagnosed with HIV in 1984.

In that formative year of the AIDS crisis — more than a decade before the introduction of HAART, the “cocktail” combination of drugs that transformed treatment — such a diagnosis was unimaginably frightening and nearly always fatal. Yet Hoff never got sick. In the ensuing years, he’d inspect his body for telltale signs of the disease, including the purple lesions of Kaposi’s sarcoma, a type of skin cancer. His immune system continued to elude the virus; the disease never progressed.

“I would meet people and it was just unbelievable, they all died. I’d make new friends and all those guys died,” Hoff told Matt Richtel, a Pulitzer Prize-winning New York Times science reporter and novelist, of his harrowing early days living with HIV. He never took antiviral drugs, but Hoff’s immune cells remained numerous and healthy. Driven to understand how and why this could be, Richtel chronicles Hoff’s fascinating experience in a new book, “An Elegant Defense: The Extraordinary New Science of the Immune System — A Tale in Four Lives.” The book also follows the complicated health trials of two women with autoimmune diseases and one of Richtel’s childhood friends who battled cancer later in life.

In between these four personal stories, Richtel weaves in intricate, sometimes obscure details on the origins of and advances in immunology, the science of the human immune system. He also explores a relatively new mode of treatment, immunotherapy, which helps the immune system fight cancer and other debilitating diseases. To lend further color to the medical narrative, Richtel interviews leading scientists and physicians in the spheres of immunology and oncology, drawing out not only their scientific perspectives but also their soulful takes on mortality. In doing all this, Richtel brilliantly blurs the lines between biology primer, medical historical text and the traditional first-person patient story.

Richtel’s bedrock is his unabashed romance with the immune system, which he affectionately nicknames “an elegant defense,” for its complex ability to ward off any number of would-be invaders that could compromise our health. “It is an ever-vigilant, omnipresent peacekeeping force in the Festival of Life,” he writes early on in the book. Like a kid spinning a superhero tale, Richtel employs delightfully effusive prose, particularly as he relates such intricacies as the science of inflammation and the roles of the immune system’s most advanced fighters, T cells and B cells, which Richtel notes are two of the most effective biological structures in the world.

“Once a T cell or B cell finds its evil mate, its infection doppelgänger, it can set in motion a powerful defense, following hard on the innate reaction, bringing in defenders trained specifically to bounce out this particular antigen. Explosions! Implosions! Toxic gas attacks! Good guys eating bad guys!”

Knowing that some readers may be less inclined to follow the wondrous minutiae of immunology, Richtel harnesses his reporter’s eye for the human condition. Beyond Hoff’s miraculous story, he relays the frustrating, often agonizing medical conundrums that befall Linda Segre, a Type A avid golfer and partner at a consulting firm who is suddenly wracked by symptoms of rheumatoid arthritis, an autoimmune disease in which the immune cells attack the joints. He also shares the experience of Merredith Branscombe, who is ultimately diagnosed with both rheumatoid arthritis and lupus — an autoimmune disease that occurs when the immune system attacks the body’s tissues and organs. She embarks on a long and winding quest for medicines that will allay her often excruciating pain.

Richtel describes Branscombe as “an immune system tinderbox” and recounts seeing the skin on her arm immediately become red and swollen upon being briefly exposed to the sun. If Hoff’s immune system had blessedly accomplished the rarest of feats and was a true medical marvel, unfortunately, “Merredith’s immune system is far out of whack, unrestrained, a killer inside her. So is Linda’s,” Richtel explains.

He draws frequently on the analogy of the immune system’s quest to identify the “self” and the “alien” within, in doing so highlighting society’s parallel struggle and the lessons we still need to learn. “Xenophobia, blind nationalism and racism, is an autoimmune disorder,” he says. “A culture, tone deaf in its own defense, attacks so aggressively that it puts itself at serious risk. Biology’s lessons, honed like water-polished stone, teach us that cooperation with our species’ diversity is undeniably key to harmony and survival.”

The heart of “An Elegant Defense” resides within the story of Jason Greenstein, Richtel’s friend since their early Little League baseball days in Boulder, Colo. Richtel describes Greenstein’s wanderlust and greasy old minivan, the entrepreneurial spirit that spurs “Greenie” to travel to far-flung casinos to sell trinkets, his high-pitched laugh, and his indefatigable optimism and off-color humor, even in the face of being diagnosed with terminal Hodgkin’s lymphoma. To give you a sense of the latter, when a deathly ill Greenstein drags himself to the Colorado Blood Cancer Institute and his doctor asks what’s going on, Greenie jokes, “I’ve been spending all my money in Vegas on hookers.”

Richtel confides that it is Greenstein’s journey with cancer that drew them closer and was also his impetus for writing the book. “The deep friendship I wound up forming with Jason captures a searing truth instructed by the immune system. We are in this together,” he says.

An Elegant Defense

The Extraordinary New Science of the Immune System: A Tale in Four Lives

By Matt Richtel

William Morrow. 435 pp. $28.99