Huge, huge amounts of drug discovery is funded by governments[0] around the world. Pharmaceutical companies step in to fund the trials after the promising results come out. A lot of the trials take place in India under ethically concerning conditions[1].
[0] http://www.ncbi.nlm.nih.gov/books/NBK50972/
[1] http://www.who.int/bulletin/volumes/86/8/08-010808/en/