If you were shocked by the MPs expenses scandal, try this one: in America, a popular media doctor, Drew Pinsky, goes on air to praise the antidepressant Wellbutrin. What's so great about it? Whereas other antidepressants lower libido, this drug "may enhance" sexual arousal. What his loyal listeners don't know is that Pinsky has been paid $275,000 by GlaxoSmithKline "for services to Wellbutrin".

They might never have found out if the US Justice department hadn't taken GSK to court for illegal marketing and failing to report drug safety data. The nine-year investigation led to a $3bn fine. (Other pharmaceutical companies have been fined for similar misdemeanours.) This example doesn't make it into Ben Goldacre's Bad Pharma, his calmly outraged account of how the $600bn drug industry, doctors, academics, regulators and medical journals have let patients down. But it is by no means extraordinary.

Goldacre's previous book Bad Science is an easier read, since exposing charlatans can, at times, be played for laughs. Bad Pharma is altogether more sombre and grim – a thorough piece of investigative medical journalism. What keeps you turning its pages is the accessibility of Goldacre's writing (only slightly flabby in places), his genuine, indignant passion, his careful gathering of evidence and his use of stories, some of them personal, which bring the book to life.

His tales of drug companies buying the opinion of doctors is not the most alarming of his revelations. Goldacre sets out clearly what is wrong with the way drugs get on to the market. New drugs are tested by the companies that make them, often in trials designed to make the drug look good, which are then written up and published in medical journals. Unless, that is, the company doesn't like the result of the trial (maybe it shows the drug not working or having severe side-effects), in which case this result might be hidden. Regulators should have all the data on a drug's effects but they often don't share it, so researchers can't study the data. The book gives examples of regulatory bodies handing over page after page containing blacked-out results to academics trying to collect data from unpublished trials, the excuse for non-disclosure being commercial sensitivity. Companies pay doctors to extol the virtues of their drugs on the conference circuit (spelling out the sources of information they want doctors to use) and fund patient groups to lobby regulators to approve new drugs. Academic journals (I work for one, the BMJ) are sent research papers and comment pieces that may not always be written by the academics listed as the authors. If a journal does decide to publish a paper showing the benefits of a drug, it can be rewarded by the company which made it, who might buy up hundreds of thousands worth of reprints (glossy versions of the published paper) to distribute to doctors to encourage them to prescribe the drug.

Doctors generally want to do the best for their patients, but they can't know what that is if half of the data on clinical trials of drugs is missing and some of the rest is distorted. The editors of medical journals want to publish good research but know, as Goldacre says, that when companies test their shiny new drug against other treatments, they don't always play fair. The vital comparison may be made against a placebo (Goldacre gives a harrowing account of how such a trial led to children in India dying when there was a perfectly good drug to treat them) or against unusually low or abnormally high doses of the drug – to ensure suitable conclusions as to efficacy and the severity of side-effects. It's no surprise that most published trials funded by drug companies show positive results.

Poor trials you can at least analyse. Missing data, Goldacre says, poisons the knowledge-well for everyone. Consider rosiglitazone, a new type of diabetes drug, which was greeted with real enthusiasm in 2005-6. This was partly because, unlike most new pharmaceuticals, it wasn't a "me too" drug. (With "me too" drugs companies tinker with a product they already sell but that is coming out of patent – it's a cheaper way of making a "new drug" although its additional benefits may be minimal.) Rosiglitazone was lauded for reducing blood sugar levels in people with diabetes and so for reducing heart attacks. Before long, however, John Buse, a doctor from the University of North Carolina became concerned that instead of reducing heart problems, the drug was actually increasing them. His head of department was rung by GlaxoSmithKline, the company who made the drug; a US Senate Committee later released a report saying Buse had been subject to intimidation. Later, GSK added up results from many trials and found Buse was right. They released their results, but only after two years. Independently Steve Nissen, a cardiologist, did his own analysis and found a 43% increase in the risk of heart problems with rosiglitazone. In 2010 the drug was taken off the market.

What will be the response to Goldacre's book? Drug companies may say that the problems he identifies have now disappeared. New rules insist they register the details of trials, and publish the results – whether negative or positive. But as Goldacre points out, little has really changed, because no one checks up.

Poor research and bias cannot be placed simply at the door of drug companies. The BMJ revealed earlier this year that half of publicly funded research in America wasn't published within the required time period. Doctors are often resistant to the notion they could ever be influenced by ads and sponsorship, even though the evidence to the contrary is overwhelming. They also rely on education paid for by drug companies because (unusually among professionals) they are loath to pay for it themselves. At the BMJ we are revising our declarations of interest form to say we will seek to work with doctors who have not received financial hand-outs from drug companies (funding for research is different).

But pharmaceutical companies are, after all, not charities. They exist to make and sell drugs, some of which work well, and to make a profit for their shareholders. They may talk as if they want to improve healthcare and sometimes they mean it, but only proper regulation from external agencies will make any difference. There is evidence that companies spend much more on marketing than they do on research and development (in America 24.4% of the sales dollar is spent on promotion versus 13.4% on research and development). They also inflate the cost of developing new drugs – Goldacre cites companies claiming that it costs £550m to bring a new drug to the market but says others put it at a quarter of that cost.

Some of what Goldacre wants to see is indeed happening – in America the so called Sunshine Act will mean pharmaceutical companies must say how much they have paid doctors and for which activities. And websites such as ProPublica already enable any patient to see what his or her doctor has been paid by the industry. One of Goldacre's innumerable discoveries is that in 2010 a Dr Emert in West Hollywood ate $3,065 of food paid for by Pfizer. Since this book's publication GSK has already announced it will make all its trial data available. Perhaps Goldacre's medicine is already working.