It all began with a single X-ray.

It was 1974, and surgeons had been doing total hip replacements for a dozen years.

"Total hip replacement is an absolutely magnificent operation," says Dr. William H. Harris, "and we were able to do remarkable things to restore mobility and relief of pain and the joy of life to countless individuals."

As chief of Massachusetts General Hospital's joint replacement surgery, Harris was sent a mystifying patient, a prominent lawyer from San Francisco whose hip replacement had gone badly awry.

"I had never seen anything like this before," he recalls. "The bone around his prosthesis, around his total hip, had been completely destroyed. It was just astonishing. And I thought it had to be cancer."

But under the microscope there was no cancer, no recognizable disease of any kind. It was something much stranger.

So begins the twist-filled backstory of disaster averted that Harris tells in his new book, "Vanishing Bone: Conquering a Stealth Disease Caused by Total Hip Replacements."

Now 90, Harris holds an endowed professorship of orthopedic surgery at Harvard Medical School. He was chief of joint replacement surgery at MGH for 30 years. And he's one of the doctors and researchers that grateful recipients of artificial hips may want to thank.

Those patients are legion: At least 3 million Americans have artificial hips, and millions more around the world.

Back to his tale: No visible cancer. The only type of cells to be seen on the ruins of the bone were a sort of cleanup cells, called macrophages. And they were stimulating another kind of cell, called an osteoclast, which means "bone-eater."

"This was the only cell in the body that could eat bone and it was actively and aggressively eating the bone," Harris explains. "It became a medical detective mystery: What in the world is this disease and how does it come about? Why is it there?"

Dr. William H. Harris at WBUR (Jesse Costa/WBUR)

The question quickly became even more urgent, because soon it wasn't just one patient or two whose replacement hips were being attacked by this bone-eating disease. It was thousands — then hundreds of thousands. The longer people had their replacement hips, the higher the risk. In some, their bones became so weak, just walking could make them snap.

"Over time, it began to involve so many people that around the world there were a million people with this condition," Harris says. "By 1990 it was clear that it was the No. 1 problem in total hip replacement surgery and the No. 1 cause of failure."

One of the first possible culprits to come under suspicion was the "bone cement" — the glue used to affix the artificial joint to the patient's skeleton. Tiny bits of the cement seemed to be triggering the odd response by the cleanup cells and the osteoclasts.

So Harris and others devised techniques to replace hips without using the cement. And they heaved a sigh of relief, he says, thinking they'd solved the problem. Only to find, when he reviewed his first hundred cases of a cementless hip replacement — "Bingo, the very same disease."

But they were on its trail. The problem wasn't just the bone cement, they realized, it was that that tiny bits of plastic could eventually trigger the osteoclasts to eat bone. And those bits of plastic were coming from the inevitable wear on the plastic at the replacement joint as the patient logged millions of steps.

"This caused a big shift in our thinking, and the problem shifted from being a problem of medical detective work to find out what in the world is going on, to innovation — material science," Harris says.

Harris and other researchers needed to figure out how to make an artificial hip joint that could take a load of hundreds of pounds, for millions of steps, without wearing down enough to release the particles of polyethylene plastic. And to do that, he decided, he needed a machine that could simulate what happens to hips in the body.

It took three years and plenty of frustration to build an accurate "hip simulator." Meanwhile, his team gained a pivotal insight from using a powerful scanning electron microscope to look at the replacement hips of patients who donated them back to his lab after death: It was the actual process of walking that modified the polyethylene.

The polyethylene plastic that they were using in the body was an extraordinarily long molecule. Harris compares it to a very, very long, very, very thin string of spaghetti. And normally, the plastic is like a bowl of spaghetti that is unorganized, with the strands going in all different directions. But not in the hips from the deceased patients.

"We found that all of the strands of the polyethylene were lined up in a row," he says. "The polyethylene molecules had been changed in their position. They'd been modified by the fact that gait simply goes back and forth, and forth and back. And that lines them up."

Harris turned to his friend Ed Merrill, a professor emeritus of polymer chemistry at MIT, and asked if he could stop this reorientation from happening.

"He said, 'Sure,' and I said, 'I love it, that's wonderful, tell me about it. How are you going to do it?' 'Well,' he said, 'we do that for a lot of molecules. We get them to be fixed in their position by putting in energy, and that energy then links one of the molecules to the next one.' "