Tax law does not name medical marijuana specifically as a prohibited drug, especially not if it is Physician prescribed and filled by a pharmacy. I would submit that state laws proclaiming prescription marijuana as a legal prescription medication with protocols that meet a state standard is a legal and valid deduction. The IRS requirements of reasonable and necessary would support this claim. No code has specifically been written excluding medical marijuana, that in itself, lends credibility to the claim.
It would be futile to write such a code with 35 of 50 states in the process of making prescription marijuana a legal alternative pain medication.
Per IRS Publication 502:
You can't include in medical expenses amounts you pay for controlled substances (such as marijuana, laetrile, etc.) that aren't legal under federal law, even if such substances are legalized by state law.