The reason is insurance. When individuals are paying for drugs, drug companies can only charge what individuals can afford. When insurance is paying for drugs, drug companies charge what insurance companies can afford, and insurance companies are able to pay much higher prices (and they recover their costs by raising premiums.) You can't blame pharmaceutical companies for not leaving money on the table.
The fact that Medicare is legally not allowed to negotiate drug prices (a big handout by Bush administration to Big Pharma) isn't helping either.