“Did you ever think you would be so old?”

The question startled me. If anyone knew where the time goes, I would have expected it to be the man across the lunch table, Alan Lightman.

Dr. Lightman is best known in literary circles for his 1992 novel, “Einstein’s Dreams,” which is all about the vicissitudes — romantic, physical and otherwise — of time. It recounts the nightly visions of a young patent clerk in Bern, Switzerland, as he struggles to finish his theory of relativity. Each dream explores how a different version of time might play out in the lives of the clerk’s fellow citizens.

But before that, Dr. Lightman was an astrophysicist, a card-carrying wizard of space and time, with a Ph.D. from the California Institute of Technology and subsequent posts at Cornell and Harvard In 1989, at the peak of his prowess as a physicist, he began to walk away from the world of black holes to enter the world of black ink and the uncertain, lonely life of the writer.

Recently he was in New York for the opening of “Einstein’s Dreams,” an off-Broadway play based on his book. There have been dozens of such stage adaptations over the last 30 years.

We had crossed paths for decades — following similar tracks, in my own mind at least. In the 1970s, while I was an editor at Sky & Telescope magazine in Cambridge, having renounced my own ambitions in physics, he was an astrophysicist just up the hill at Harvard, writing essays and poems in his spare time.

In 1990 and 1991, we both published books about cosmology, which were reviewed together in places like Scientific American and the New York Review of Books.

When “Einstein’s Dreams” came out, I praised it in The Times through clenched, jealous teeth. I was working on my own Einstein book, and I had been to Bern, where Einstein hatched relativity. Dr. Lightman, it turned out, had not been there, but his fables conveyed more of the life and charm of the place than my own descriptions did.

In person, Dr. Lightman is soft-spoken, with a tangibly southern twang at times, and, as in print, he wears his erudition lightly. “Alan is a nice guy,” said cosmologist Janna Levin, who teaches “Einstein’s Dreams” in her classes at Barnard and Columbia.

Dr. Lightman grew up in Memphis, the son of a movie-theater owner and a dance teacher and Braille typist. He was a boy who could launch a rocket with a tadpole in it and bring it back alive to the ground (although without its tail) and also win the state National Council of Teachers of English literary award.

As he tells it, he began worrying about getting old long ago, while he was still a young graduate student at Caltech. When he talked to other graduate students there, “I could see that they wanted to do physics, come hell or high water, for the rest of their life,” he said. “And I didn’t quite feel that way.”

He ran in a fast crowd. “Alan was one of the amazing cadre of Kip Thorne relativity students in the 70s,” said Michael Turner, a cosmologist and former Caltech student now retired from the University of Chicago. (In 2017, Dr. Thorne, with Barry Barish and Rainer Weiss, won the Nobel Prize in Physics for the discovery of gravitational waves.) Richard Feynman, Caltech’s resident eccentric genius, would drop by and dazzle them with impromptu blackboard calculations.

“I could see their minds working and just see that they just had a very, very high capacity and ability to see things,” Dr. Lightman said.

Dr. Lightman would go on to have his own moments. He described one such incident in a memoir, “Searching for the Stars from an Island in Maine,” when, early in his research career, a difficult calculation fell suddenly into place: “My head was floating off my shoulders. I felt weightless. I was floating. And I had no sense of my self, where I was, or who I was. I did have a feel of rightness.”

Many scientists will tell you these are the most precious moments in their lives. Dr. Lightman said that it had happened to him five or six times in his scientific career. But he believes most theorists dry up by the age of 40 or so. “You just seem to have more of what it takes at a young age,” he said. “It’s kind of like athletic limberness.”

In 1989, at age 41, he joined M.I.T. with a rare joint appointment in physics and humanities.

“I love physics, but what was even more important to me was leading a creative life,” Dr. Lightman said. “And I knew that writers could continue doing their best work later in life.”

His parents were nervous on his behalf, and he himself was a little frightened. “I was worried that my scientific colleagues would think I had chickened out,” he said. “And I was worried that my new writing colleagues would not accept me as a writer.”

“Einstein’s Dreams,” published three years later to rapturous reviews, was runner-up for the 1994 PEN New England/Boston Globe Winship Award.

“By turns whimsical and meditative, playful and provocative, ‘Einstein’s Dreams’ pulls the reader into a dream world like a powerful magnet,” Michiko Kakutani wrote in The Times, with references to Italo Calvino and Jorge Luis Borges.

His novel “The Diagnosis” was a finalist for the National Book Award in 2000. He is now a member of the American Academy of Arts and Sciences, with 16 books to his credit. His main academic duty these days is teaching an essay-writing class at M.I.T. He also runs a foundation devoted to helping young women in Southeast Asia improve their leadership skills.

There are still weightless moments, he said, where he forgets who he is. “Island,” a meditation on science and spirituality, starts off with his ego dissolving as he stares up at the night sky from the bottom of a boat. “Yeah, I’ve had it writing, when you really get into the material and you lose track of yourself,” he said.

“Einstein’s Dreams,” now translated into 30 languages, has become a pop-science landmark. The book was at the bedside of the writer Christopher Hitchens when he died 2012. He quoted from it at the end of his final book — “Mortality,” a memoir — in a chapter describing a version of time in which nobody dies. As a result, the generations pile up, carping, criticizing and advising, and no one ever comes into their own. “Such is the cost of immortality,” Mr. Hitchens wrote. “No person is whole. No person is free.”

Of the many stage versions of “Einstein’s Dreams,” Dr. Lightman has seen only a few, preferring to keep a distance and give the directors free rein. As it happened, I had seen some of those plays, including the recent version that Dr. Lightman was seeing that night.

“My god, it’s been a long association,” he said. The thought sent him spiraling down the corridors of time.

“When I was in my 20s and 30s, I never imagined being this age,” he said. “I knew theoretically you know unless I got some terrible disease that I would eventually be this age. For years and years and years I was the youngest person in the room, and now it seems like I’m the oldest person in the room. And I wonder: How did that happen?”