When doctors are deciding which drug to prescribe a patient, the idea behind evidence-based medicine is that they inform their thinking by consulting scientific literature. To a great extent, this means relying on medical journals.

The trouble is that pharmaceutical companies, who stand to win or lose large amounts of money depending on the content of journal articles, have taken a firm grip on what gets written about their drugs. That grip was strong way back in 2004, when The Lancet's chief editor Richard Horton lamented that "journals have devolved into information laundering operations for the pharmaceutical industry." It may be even tighter now.

Drug companies exert this hold on knowledge through publication planning agencies, an obscure subsection of the pharmaceutical industry that has ballooned in size in recent years, and is now a key lever in the commercial machinery that gets drugs sold.

The planning companies are paid to implement high-impact publication strategies for specific drugs. They target the most influential academics to act as authors, draft the articles, and ensure that these include clearly-defined branding messages and appear in the most prestigious journals.

Over the past few months I've tried to find out as much about these companies as possible. I wanted to know how big this industry is, exactly how it operates, and how people in the business think about their work. It's a nervous, opaque industry, but I did find answers to some of my questions.

There are now at least 250 different companies engaged in the business of planning clinical publications for the pharmaceutical industry, according to the International Society for Medical Publication Professionals, which said it has over 1000 individual members.

Many firms are based in the UK and the east coast of the United States in traditional "pharma" centres like Pennsylvania and New Jersey.

Precise figures are hard to pin down because publication planning is widely dispersed and is only beginning to be recognized as something like a discrete profession. These numbers are higher than any previous estimate, yet in truth the industry is likely to be bigger still.

In selling their services to drug companies, the agencies' explain their work in frank language. Current Medical Directions, a medical communications company based in New York, promises to create "scientific content in support of our clients' messages". A rival firm from Macclesfield, Complete HealthVizion, describes what it does as "a fusion of evidence and inspiration."

Having talked to over a dozen publication planners I found that the standard approach to article preparation is for planners to work hand-in-glove with drug companies to create a first draft. "Key messages" laid out by the drug companies are accommodated to the extent that they can be supported by available data.

Planners combine scientific information about a drug with two kinds of message that help create a "drug narrative". "Environmental" messages are intended to forge the sense of a gap in available medicine within a specific clinical field, while "product" messages show how the new drug meets this need.

But the issue that dominates industry discussions is authorship.

In a flow-chart drawn up by Eric Crown, publications manager at Merck (the company that sold the controversial painkiller Vioxx), the determination of authorship appears as the fourth stage of the article preparation procedure. That is, only after company employees have presented clinical study data, discussed the findings, finalised "tactical plans" and identified where the article should be published.

Perhaps surprisingly to the casual observer, under guidelines tightened up in recent years by the International Committee of Journal Editors (ICMJE), Crown's approach, typical among pharmaceutical companies, does not constitute ghostwriting.

What publication planners understand by the term is precise but it is also quite distinct from the popular interpretation.

"We've never done ghostwriting, per se, as I'd define it", says John Romankiewicz, president of Scientific Therapeutics Information, the New Jersey firm that helped Merck promote Vioxx with a series of positive articles in medical journals. "We may have written a paper, but the people we work with have to have some input and approve it."

The industry has grown despite its prominent involvement in a succession of medical ghostwriting scandals.

In the early 2000s, court documents released through litigation over controversial drugs - such as Vioxx and the hormone replacement therapy Prempro - showed pharmaceutical companies frequently hiring medical communication agencies to ghostwrite articles and place them in influential medical journals under the "authorship" of well-known academics paid thousands of pounds for their endorsement.

The ICMJE tweaks, plus a new willingness to disclose their involvement in the preparation of articles, has fostered a remarkable confidence among industry proponents.

"I feel that we're doing something good for mankind in the long-run," said Kimberly Goldin, head of the International Society for Medical Publication Professionals (ISMPP). "We want to influence healthcare in a very positive, scientifically sound way."

"The profession grew out of a marketing umbrella, but has moved under the science umbrella," she said.

But without the window of court documents to show how publication planning is being carried out today, the public simply cannot know if reforms the industry says it has made are genuine.

Dr Leemon McHenry, a medical ethicist at California State University, says nothing has changed. "They've just found more clever ways of concealing their activities. There's a whole army of hidden scribes. It's an epistemological morass where you can't trust anything."

Alastair Matheson is a British medical writer who has worked extensively for medical communication agencies. He dismisses the planners' claims to having reformed as "bullshit".

"The new guidelines work very nicely to permit the current system to continue as it has been", he said. "The whole thing is a big lie. They are promoting a product."

Matheson expects an article he wrote about a new cancer treatment to appear in print later this year, with an oncologist considered a "key opinion leader" (KOL) by planners listed as the author in his stead. "You'd do the same thing if you were selling cornflakes," Matheson told me. "It's no different."

And with the industry business model that is all about facilitating the influence of business over science thriving as it is, it's hard to see when, if ever, we will again see the thick line one likes to imagine there once was between the sale of cornflakes and the analysis of medicine. It has all become rather blurry.

• Elliot Ross is a Fulbright scholar currently based at Columbia University