The answer is quite simple.
Drug manufacturers maximize profits by charging different parts of the market different prices.
Each segment is charged the highest price it will bear. Seniors who buy their own medications are the big losers in this battle for bucks. Medicare doesn't cover prescription drugs, and many seniors are not insured adequately for this expense. Because they have no bargaining power and they must take these drugs to preserve their lives or health, they are forced to pay the high prices charged by the drug manufacturers. The winners are favored customers with the buying power to negotiate discounts.