Viagra, which was originally developed as a treatment for angina. Photograph: AFP

It was probably a bad day at the lab when scientists at the US drug group Pfizer's now defunct Sandwich research centre realised an angina treatment they were developing – a compound called sildenafil – simply didn't work.

It might have been the end of the road for compound UK-92,480 but the drug did have an interesting side-effect: three days after swallowing the pill the male volunteers testing the medicine got a prolonged erection.

The treatment was refined and the time delay reduced. It was branded as Viagra and has become a blockbuster, prescribed for erectile dysfunction.

As Ian Osterloh, who led its development, recounts: "None of us at Pfizer thought much of the side-effect at the time. I remember thinking that even if it did work, who would want to take a drug on a Wednesday to get an erection on a Saturday?"

But today the little blue pill is prescribed to millions of men all over the world and made Pfizer nearly $2bn in sales last year.

It isn't the only drug originally tested for one purpose that has become a treatment for another. Rogaine, also by Pfizer, was originally developed to treat high blood pressure but is now a successful treatment for hair loss.

Finding new uses for old drugs is a growth business as big pharma struggles to come up with new blockbuster drugs. Traditionally pharmaceutical companies test hundreds of thousands of compounds for so-called "target binding" in the hunt for new blockbusters. It takes 10-15 years to find a medicine that works and is safe, at a typical cost of $1.3bn.

Recycling old compounds for new uses is far cheaper – and faster. The idea – known in the drugs' business as repositioning or repurposing – was first floated in the early 1990s but has gained momentum as the pipeline of potential blockbusters has dried up. Next week scientists and pharmaceutical professionals will descend on Washington for the World Drug Repositioning Congress.

A number of university-based spin-outs and small biotech companies have been set up to find new uses for old drugs that were shelved because they didn't work. They take advantage of the declining cost of screening, with some compound libraries – such as the Johns Hopkins library, which includes 3,500 drugs – available for screening at a small charge.

"There will be no more blockbusters and it's a massive worry for the industry," says Dr Farid Khan, a former GlaxoSmithKline executive who is about to launch PharmaKure, a spin-out from the University of Manchester.

"Existing drugs have been shown to be safe in patients, so if these drugs could be found to work for other diseases, then this would drastically reduce drug development costs and risks. Of 30,000 drugs in the world, 25,000 are ex-patent – it's a free-for-all."

He thinks he may have stumbled across a potential preventative drug for Alzheimer's. PK-048 was first developed in the 1980s for Parkinson's by Abbott Laboratories and had never been tested for the most common form of senile dementia, which affects more than 15 million people worldwide. Trials with chimpanzees suggested it can be taken orally, is non-toxic and crosses the blood-brain barrier in primates, which is vital for an Alzheimer's drug.

Khan and his business partner Andrew Doig, a professor at Manchester University and an expert on Alzheimer's, have tested the drug and found it blocks the toxic effects of beta-amyloid plaques before they kill brain cells, which is thought to be the cause of the debilitating disease. The four Alzheimer's drugs on the market alleviate symptoms but offer no cure. Numerous medicines are being developed, for example by AstraZeneca in partnership with Axerion, but there have been failures in recent clinical trials,such as Eli Lilly's experimental drug.

Khan and Doig believe it is possible their drug could act as a prophylactic medicine for patients diagnosed early and those who are at high risk of getting Alzheimer's. Khan is hopeful he can raise £1m to fund trials of the drug in mice and humans, with US venture capitalists having shown interest, but he is also looking for a partnership with a big pharmaceutical company in the long run.

Dr Aris Persidis, president and co-founder of the US drug repositioning firm Biovista, points out that between 2007 and 2009, 30% of all newly marketed medicines were either existing drugs or new formulations of old drugs. "Typically, repositioning is done by accident, or in a limited way," he wrote in an article on drug repositioning last year.

"New technologies however enable the systematic evaluation of any drug or mechanism of action against any disease."

Biovista is in the process of filing for novel use patents for 12 drugs with potential in Parkinson's, Alzheimer's, epilepsy, depression and sleep disorders. Clive Morris, head of the new opportunities division at AstraZeneca, says medicines that have already been in clinical trials can skip the early phase of drug development and go straight into phase two (mid-stage) trials, which can save three to five years. AstraZeneca is now testing a failed diabetes and obesity drug for use as a glaucoma treatment.

The big drug makers are also offering compounds to other researchers. Last month, AstraZeneca made 22 failed medicines available to academics through a partnership with the Medical Research Council and it also struck a £180m partnership with its bigger rival GlaxoSmithKline in May to boost the faltering development of new antibiotics, dubbed NewDrugs4BadBugs.

Repositioned drugs

Viagra – developed by Pfizer for heart disease, then became a blockbuster drug for erectile dysfunction

Rogaine – another Pfizer discovery, originally used to treat high blood pressure, now a treatment for hair loss

Cymbalta – initially developed by Eli Lilly as an antidepressant, but later approved for fibromyalgia, a long-term condition which causes pain all over the body

Gemzar – an Eli Lilly antiviral which became a cancer drug

Evista – an Eli Lilly birth control drug that was repositioned as an osteoporosis treatment and can also prevent breast cancer

Aspirin – developed by Bayer in 1897, originally for inflammation and pain, but now also used as an antiplatelet drug for treating and preventing heart attacks and strokes. One of the most widely used drugs in the world

Ibuprofen – anti-inflammatory drug, developed by Boots in the 1960s as a treatment for hangovers and rheumatoid arthritis, which recent studies show can help protect against Parkinson's disease