The real crazy story is how anyone can buy any CAS numbered compound from a lab for usually thousands of times less per mg than at a pharmacy.
An example is Azithromycin, which typically costs about $15/pill at 500mg, yet if you buy it direct from a lab that syntethizes the compound themselves at 99% purity, it costs around $0.04 for the same pill.