Residents in 14 states and Washington can now appeal to their doctors for prescriptions for medical marijuana to help them with their pain.

Their employers, however, may not be so understanding.

In some cases, workers have been fired for failing drug tests despite having prescriptions saying, in effect, that what they are doing is legal according to the laws of their states.

Though the number of such cases appears to be small, they are exposing a new legal gray area, with workers complaining of rights violations and company officials scratching their heads over how to enforce a uniform policy for a drug that the federal government has not recognized as having a legitimate medical purpose.

“The current state of affairs puts employers in a very difficult situation,” said Barbara L. Johnson, an employment lawyer in Washington. “But the reality is that there are no federal guidelines like there are when dealing with other types of prescription medications.”