A pill may work as well as a puff when it comes to using marijuana to treat pain, according to a small but carefully controlled new study. Pain relief from pills may last longer, however, and may not leave people feeling as high as they do after they smoke the drug.

Medical marijuana is now legal in 18 states and the District of Columbia, according to the nonprofit group ProCon.org. Surveys show pain is one of the main reasons doctors prescribe it. But studies testing marijuana as a pain reliever have had mixed results. Some have shown that it works as well as mild opioid (narcotic) pain relievers like codeine, while others have indicated that the drug might actually make pain worse.