For most insurances (Medicare included), you can either:
1) Buy and bill. Most insurances will reimburse you at least what you paid on most medications. However, there will be cases where you lose money on the medications if you don't properly manage this. To my knowledge, Medicare (and MOST major carriers) do not care what your office specifically paid for the medication and will only reimburse whatever your contracted rate is (ie 106% of AWP or something along those lines.)
2) Have the medication supplied through the patient's prescription benefit (which sometimes requires using their insurance's specialty pharmacy). You run 0 financial risk. You will frequently need to obtain authorizations/prior approvals, etc. The pharmacy will bill under Part D for the meds. Your office will bill under Part B for the administration only.
Little bit of history, specifically for oncology offices. Somewhere about 12 years ago, Medicare decided physician offices are not pharmacies and should not be making huge profits on medications. Prior, Medicare reimbursed nicely for J codes, and not so well for the administration. Then, the chemo administration codes got revamped and Medicare paid better for administration, and J code reimbursement went down. If you are part of a large medical practice with buying power (or getting some other discount), you were still able to do a little better than break even on J codes. If you were a mom & pop style office with no negotiating power who was buying and billing all medications, you either realized this quickly and re-structured, or you went belly up. In our office, we created a table of each medication with each insurance carrier to decide if we would supply, or would put it through pharmacy benefits. I will note that there were some patients that putting it through pharmacy benefits wound up costing the patient more in out of pocket expenses. We did whatever we could to minimize this for our patients, but as a 1 doc office (at the time), we simply could not afford to lose $300 per cycle on an expensive chemo med. Over the years, we have basically switched almost exclusively to option #2 above as more and more insurances adopted the Medicare standpoint.