The dead can speak to us. I know I hear them.

I'm listening right now to the voice of my grandpa, which sounds thin and warbled, liked a clogged whistle. "You should become a doctor," he's saying.

When Grandpa was alive, my future employment was just about the only topic we discussed. That wasn't because we didn't see each other often (he lived a few miles away) or because he died when I was 14. It's because the topic of whether I would pursue medicine came up a lot.

While we were playing checkers: "You should become a doctor." In the car to a restaurant that would cook meat the only way he'd eat it (burnt to a cinder): "You should become a doctor." Interrupting sustained periods of silence: "You should become a doctor."

When choosing a major in college, I instantly heard my grandpa — then a few years gone — and his refrain. Grandpa was there to offer me advice. I chose to ignore him.

Kurt Gray, a psychologist at the University of North Carolina, can also hear the dead. But even better, the researcher on mind perception can explain how and why.

How we hear the dead

As Gray explains it, "Humans have developed the ability to have offline models of people’s minds." In other words, our minds can generate a sort of simulation of other people’s minds. Which explains why when we remember a person, we're not only remembering their voices. We're remembering their personalities, their behaviors. We can imagine what they might do, even when they're not there. These models of their minds can exist in our minds long after the person perishes.

We can do this for the dead because we do it for the living. When we interact with a person, we're constantly anticipating how they might respond. Psychologists call this "perspective taking," or theory of mind, and it's what has allowed for humans to thrive in social groups. "When we know someone well enough, we don’t have to base their thoughts on our own thoughts; we just know their thoughts," Gray says.

In some respects, we know others better than we know ourselves. When asked if I'm going to eat an extra slice of cake, I say no. But my best friend knows I'm going to do it anyway. One joy of loving another person is having this knowledge grow intense, intimate, and absurdly specific.

How the dead can guide us

Gray is interested in this because he's a scientist. But he also knows it from his own experience with loss.

When Gray finished his PhD studies in 2010, his longtime mentor Daniel Wegner told him he had been diagnosed with amyotrophic lateral sclerosis, or ALS. It was a death sentence. But Wegner had a book project he wanted to complete and asked his former pupil to see it through. It was kind of a "last request from a dying man," Gray explains.

The Mind Club, published in March, is a layman's guide to understanding how humans come to understand the minds of others. The book dives into questions like why we see caring minds in some animals (like dogs) but not others (like cockroaches), why we can dehumanize enemies, and how we make moral judgments, such as when to pull the plug on a comatose patient. It also has a chapter on death, explaining humanity's unshakable tendency toward dualism — seeing the mind and body are two separate entities.

The main question Wegner and Gray sought to answer in their research was where and why people draw the line between perceiving another (or an inanimate object) as having a mind or not. What they found is that minds exist on a continuum. For example, a robot is seen as having agency — the ability to think and exhibit self-control — but not experience, i.e., the ability to feel emotions.

They also explore how we think about the minds of the dead. "The minds of others in death stay as we knew them in life, even if we knew them only briefly," they write. "But we also tend to exaggerate who they were — the good becoming truly heroic and the bad becoming truly evil."

When Wegner died, Gray had many chapters left to write on his own. What made it less daunting was the fact that he could still imagine the voice of his old mentor guiding him, making edits, pushing Gray to keep the text light with a screwball sense of humor.

"It didn’t really feel like Dan had passed away as much while I was still working on the book," he tells me. That's because he could access his mental simulation of Wegner and hold conversations with it.

Gray described this experience in a charming essay on Medium:

As I progressed through the chapters I took solace in these conversations with Dan. To me, he was still alive because I was constantly asking myself "WWDWD?" As I wrote, I could hear him cracking jokes, or making suggestions, or — more often than I wished — telling me to cut an entire paragraph.

Other times, Gray would ignore the ghost. "A lot of times when I would hear Dan’s voice saying, 'I would do it this way,' I could be like, 'Too bad.'"

Memory gives life a second life

Science fiction visions of the future are currently enthralled with the idea that we may be able to upload our consciousness to the cloud, and live, for time immortal, in a simulation (like in the critically unacclaimed Johnny Depp film Transcendence).

But we already do this. In our interactions with one another, we're imprinting ourselves into others' memories of us. It's not immortality, but it's not insignificant either. "Especially if you have a worldview that doesn’t believe in heaven and reincarnation, this provides people with some way of holding on to loved ones," Gray says.

In the short time after people die, there's an uncanny feeling like they've just stepped out for the day; that they will return at some point. As infants we develop object permanence — the understanding that objects or people don't disappear completely when they're out of view. As adults, that feeling is hard to shake when it comes to the dead.

I never asked my grandpa why he was so persistent about me studying medicine. But now I think it was because he was starting to see lots of physicians, and they were taking whatever money he had. Aging is grotesque and costly, he might have thought. The grandkids ought to cash in.

All memories, however, even those of loved ones, grow quiet with time — and neglect. When Gray finished the book, he says it was like losing his mentor for a second time. With their collaboration complete, the mental ghost of Wegner quieted down. He had fewer edits to make, fewer jokes to crack. Gray learned it takes effort to keep a voice alive.

"If you want to keep someone alive, you have to keep thinking of them — and it's hard work," he says.