The drug maker Merck drafted dozens of research studies for a best-selling drug, then lined up prestigious doctors to put their names on the reports before publication, according to an article to be published Wednesday in a leading medical journal.

The article, based on documents unearthed in lawsuits over the pain drug Vioxx, provides a rare, detailed look in the industry practice of ghostwriting medical research studies that are then published in academic journals.

The article cited one draft of a Vioxx research study that was still in want of a big-name researcher, identifying the lead writer only as “External author?”

Dr. Peter Libby, chief of cardiovascular medicine at Harvard’s Brigham and Women’s Hospital, said that when he first began receiving offers from drug companies, in the early 1980s, they seemed like a natural reflection of his burgeoning reputation.

“When you start emerging as an opinion leader or as a researcher who has knowledge and expertise, the pharmaceutical industry takes an interest in either having you consult to help them with their research or to speak,” he said.

Dr. Libby wanted to assist. Like many scientists, he feels that it is important for researchers to consult with drug companies to help develop therapies and set up studies. He never owned stock in companies that he consulted for. He always disclosed the fact that he consulted and spoke for companies. And, he added, he thought that he was protected from accusations of favoring any particular company’s products because he consulted for so many.

“I lived safely in that comfort zone for many years,” Dr. Libby said.

Then he was hit with a moment of truth. He had spent four years working without pay to help create a public television series, “The Mysterious Human Heart.” The project was, he thought, a worthy effort to educate the public about what heart disease was and how to prevent it. He was proud and pleased when the series was broadcast in October.

But to his dismay, bloggers immediately attacked him and the other medical experts who appeared on the programs for having consulted for manufacturers of pharmaceuticals and medical devices, Dr. Libby said, adding: “They said we were biased. What I thought was four years of public service was impugned.

“That was a wake-up call for me. I was singed in the blogosphere.”

This year, he made his decision. He would continue speaking at forums sponsored by the pharmaceutical industry and would continue consulting for companies. But he would no longer accept payment.