As doctors try to ensure their patients do not abuse prescription drugs, they are relying more and more on sophisticated urine-screening tests to learn which drugs patients are taking and — just as important — which ones they’re not.

The result has been a boom in profits for diagnostic testing laboratories that offer the tests. In 2013, sales at such companies are expected to reach $2 billion, up from $800 million in 1990, according to the Frost & Sullivan consulting firm.

The growing use of urine tests has mirrored the rise in prescriptions for narcotic painkillers, or opioids. But the tests, like earlier efforts to monitor opioid prescribing, have led to a host of vexing questions about what doctors should do with the information they obtain, about the accuracy of urine screens and about whether some companies and doctors are financially exploiting the testing boom.

For one, the tests are showing that large numbers of pain patients are not taking prescribed drugs or are taking substances not given them by a doctor. For example, a recently published study of 800 pain patients treated at a Veterans Affairs facility in North Carolina found that one-quarter of them tested negatively in a urine-screen test for a drug they had been prescribed, while 20 percent of patients tested positively for an illicit drug or a narcotic painkiller that was not prescribed.

Such findings are in line with data recently released by Ameritox, one of the country’s biggest urine-screening laboratories. In reviewing some 500,000 tests it analyzed in 2012, the company said that about one-third of the tests failed to detect the drug prescribed by a doctor. In about 75 percent of those cases, the drug at issue was a narcotic painkiller, Ameritox said.

The simple fact that a patient tests negatively for a prescribed drug does not necessarily mean they are selling it; it could simply mean they decided to stop taking it. Still, doctors say they now face tough choices about what to do with patients when tests show they are not taking prescribed drugs or are mixing them with unapproved drugs or illegal ones.

For example, Dr. Roger Chou, who helped develop urine-screening guidelines for a professional medical group, the American Pain Society, said he believed that the tests were a valuable tool. But he added that he was concerned that doctors, to protect themselves, would use the tests as an excuse to drop, or “fire,” patients rather than steer them into addiction treatment or alternative pain management programs.

“I think that it is problematic from an ethical perspective,” for doctors to fire patients, said Dr. Chou, a professor at Oregon Health & Science University in Portland.

Another specialist, Dr. Daniel Alford, says he typically has a discussion with a patient to describe unexpected test findings and their relevance to pain treatment. For example, if an illicit drug is found, he will tell patients that the use of such a drug also means they are more likely to abuse the narcotic painkiller that he is prescribing them.

But such talks may have only limited success, and some patients continue to test positive for illicit drugs, said Dr. Alford, who is a professor at Boston University. He offers to help them get addiction treatment.

“Some of those patients drop out of the practice and some of them stick around,” he said.

Urine tests are by no means the first technique that doctors have used to try to better monitor how patients are using prescription narcotics. A decade ago, so-called pain contracts — agreements that essentially allowed a doctor to refuse to continue treating patients who tried to get opiods from other physicans — were popular.

The agreements, however, proved to be of limited value, so pain specialists turned to diagnostic questionnaires that were supposedly able to predict whether a patient was likely to abuse a narcotic because of factors like a family history of substance abuse. The predictive value of such questionnaires, however, is still not clear. One review found that 60 percent of patients who abused opioids scored low, rather than high, on one widely used screening questionnaire.

Subsequently, doctors have turned to urine tests. There are two basic types and they vary markedly in accuracy and cost.

The basic screen is known as qualitative test. Typically, a patient leaves a sample in a cup imbedded with sensitized strips designed to detect various classes of drugs like opioids, amphetamines, barbiturates and cocaine.

Such tests, however, have high rates of false positives, findings that a drug is present when it is not, and false negatives, findings that fail to detect a drug that is present. While the tests detect some drugs in a class, they may not detect others. In the case of narcotic painkillers, methadone and some other opioids are detected but oxycodone, the ingredient in OxyContin and Percocet, is not, experts said.

The use of qualitative tests has increased sharply in recent years as a growing number of states have passed laws requiring recipients of welfare and other types of public assistance to undergo drug screening. The American Civil Liberties Union has challenged such laws, saying they violate Constitutional protections against unreasonable search.

In the case of pain patients, suspect samples are subjected to a more sophisticated and costly kind of test known as a quantitative analysis. In it, precision techniques like mass spectrometry are used to detect the presence of drugs, said Jennifer Strickland, the director of clinical strategy for Millenium Laboratories, a major testing company.

The simpler qualitative tests are considered fairly easy to beat, but sophisticated drug abusers can also fool quantitative tests as well. To fool a doctor, a patient might need to take a prescribed drug for only a day or two before a test for it to show up in a screen, Ms. Strickland said. The patient could have sold the rest of the prescription.

“There is a lot of information out there,” about how to try to beat tests, she said, referring to several Web sites.

The annual costs of running regular quantitative tests to monitor a pain patient can run into the thousands of dollars. And with big money at stake, the growth of the urine screening industry has also opened the door to charges of illegal profiteering and other questionable activities.

In 2010, for example, Ameritox agreed to pay $16.4 million to settle charges that it had paid kickbacks to physicians who sent tests to laboratories. And last year, another testing company, Calloway Laboratories, paid $20 million to resolve claims brought by the State of Massachusetts that it funneled cash to operators of drug treatment facilities in exchange for test work.

Millennium Laboratories is under federal investigation, Reuters reported. The company said it was cooperating with the inquiry. Meanwhile, other urine-testing companies are aggressively marketing their services to physicians by trumpeting the big profits that await if they test their patients.

For example, a brochure distributed by one testing company, Liberty Diagnostics of Pasadena, Calif., declares that doctors can “Average $400 Profit per Screen” with “No Additional Overhead” like added staff or equipment. The brochure, which was obtained by The New York Times, also has a chart titled “Potential Profit Payout to Doctor” that states that doctors who perform 10 urine screens a week can make $155,000 annually from the tests plus an additional $133,000 for reviewing the results and discussing them with patients.

In a telephone interview, an executive of Liberty Diagnostics, Timothy P. O’Brien, declined to discuss the brochure and would not confirm its authenticity. A former sales representative for the company, after hearing a reporter’s description of the brochure, said it was genuine.