The above is of course talking about newly developed drugs. There is however a rather disturbing recent predatory practice some drug manufacturers have started to engage in of either purchasing an existing drug and jacking up the price if they're the sole manufacturer, or else making a trivial change to an existing drug and then re-releasing it at massively inflated price. In either case the effect is the same, they're selling a drug that has no appreciable research costs associated with it, just the manufacturing price, but they're continuing to charge as if they were having to offset the research costs and they get away with it because that's what people are used to.
None of the players above (including apple) engage in cost based pricing. They all charge the price that maximizes their profits, not the price that sells the most units while breaking even.