William Shatner, left, and Leonard Nimoy at the 40th anniversary of the television series “Star Trek” in Los Angeles in 2006. (Mario Anzuoni/Reuters)

A few years before Leonard Nimoy died last February at 83, he stopped speaking to William Shatner, his close friend since their many “Star Trek” adventures. As he explains in “Leonard,” his new book about that relationship, Shatner still isn’t sure what caused Nimoy to freeze out his Starship Enterprise other half. “It remains a mystery to me, and it is heartbreaking, heartbreaking,” Shatner writes. “It is something I will wonder about, and regret, forever.”

That revelation, both personal and laden with questions, is much in keeping with the overall tone of Shatner’s book. At times, the actor recounts his connection to Nimoy with great candor and reverence, particularly when he discusses how that bond solidified after the death of Shatner’s third wife, Nerine Kidd, who drowned in the couple’s pool in 1999. But readers may wish they got a little more fly-on-the-wall perspective on the lengthy friendship born in a place where few are: on the set of an iconic sci-fi TV series. As Shatner says at one point, “When I think about Leonard, my memories are emotional more than specific.” His memories often read that way, too.

“Leonard” is essentially a traditional biography, but one that is filtered through the prism of its author’s friendship with his subject. Shatner — who co-wrote the book with David Fisher , his collaborator on his 2008 memoir, “Up Till Now”— recounts his fellow star’s path from aspiring actor to the world’s most famous pointy-eared Vulcan, as well as forays into directing, philanthropy and other creative pursuits. As Shatner notes, he and Nimoy were both raised in “lower-middle-class Orthodox Jewish immigrant families” — Nimoy in Boston, Shatner in Montreal — and struggled to build acting careers that could support them and their families.

"Leonard: My Fifty-Year Friendship with a Remarkable Man" by William Shatner and David Fisher (Thomas Dunne)

That common ground, not to mention the shared experience of being associated with “Star Trek” for most of their careers, rooted them to each other. Shatner even points out that they are technically, albeit very distantly, related: “Supposedly I am Leonard’s wife Susan’s fifth cousin twice removed’s wife’s aunt’s husband’s uncle’s wife’s second grandnephew.” In Shatner’s mind they “came from the same tribe.”

As characterized by this book, the differences between the two actors mirror the differences between the characters they played: Shatner wears his feelings on his Starfleet uniform sleeve, while Nimoy was cerebral and “much like the character Spock . . . very reserved.” In keeping with Capt. Kirk’s arrogance, Shatner also sometimes has a hard time fully admitting his own fault, even in conflicts that date back decades. Shatner remembers questioning a TV Guide photographer who, unknown to him, was taking pictures on the set for a story about Nimoy’s Spock makeup. Shatner’s complaints resulted in the photographer being removed, even though, as Nimoy told his fellow actor, all the necessary superiors had approved the journalist’s presence. Nimoy would later remember that Shatner responded, “Well, it wasn’t approved by me.”

“Years later, if I really remembered saying this, I certainly would have regretted it,” Shatner writes, in a kind of mea culpa that is borderline comical.

The stories that Shatner shares about their “Trek” clashes and camaraderie — on the original series, in the movies and on the convention circuit — are largely ones that Trekkies have probably heard or read before. Certainly by now, fans know the major highlights of Nimoy’s career, although the book dutifully runs through those anyway.

The chapters that delve into Nimoy’s drinking problems, which he eventually overcame, and his strained relationship with his son, Adam, who also became an addict but eventually got clean and reconciled with his father, are more revelatory.

Nimoy’s own attachment to alcohol enabled him to provide a special kind of support for Shatner during his marriage to Kidd, who was an alcoholic, and in the wake of her death. “He enveloped me in his arms as his brother, and we cried together,” he writes. “He was always there, kind and loving and available.”

When Nimoy died last year, Shatner did not attend the funeral because he was in Florida, serving as one of the celebrity guests at a fundraiser for the Red Cross. Because he could not get back in time, he sent his daughters to the funeral to represent him. Shatner was criticized publicly for that, which he says was “painful.”

Given the way he responded to Nimoy’s death, some may find it a bit opportunistic of Shatner to publish this book as the anniversary of that passing approaches. But Shatner’s regret over his mysterious falling out with Nimoy suggests what this book really is: a goodbye, the literary equivalent of that scene in “Star Trek II: The Wrath of Khan” (1982) when Kirk and a dying Spock say farewell by placing their hands against a pane of glass. For those who still tear up at the mention of that moment, “Leonard” will feel like essential reading, even if, just like the relationship on which it is based, it leaves some lingering issues unresolved.

Chaney is a pop culture critic and author of the book “As If!: The Oral History of ‘Clueless.’ ”

My Fifty-Year Friendship with a Remarkable Man

By William Shatner with David Fisher

Thomas Dunne. 278 pp. $25.99