The dilemma lies in the fact that even a pharmaceutical company is a business and it is there in the market to earn money however if such a company starts to give free away free medicine to everybody in need, the company would go bankrupt in a short time and then it there would be no more of that drug in any case.
This problem becomes more serious when a company tests its drugs in the general market, give free samples, monitors the patients, set up offices and markets for patients etc. but when the testing ends, the company takes drug away from the people who were depending on it. Everyone cannot afford the real price of the product when it is approved by the FDA and launched because the company has to acquire patients and rights for their products thus raising their costs as well.
Something that can be done is to involve the government and the charity organizations in these cases where testing, free medicines are involved so that the company producing them can continue doing their business but the government and the philanthropists can give the poor drugs on their expense for the sake of social heath care.