JINZHOU, China — Zhang Zhejun used a fat plastic straw to gently tap the pale yellow pharmaceutical powder onto a piece of silver foil that lay on an electronic scale. He made sure the amount was just right before he poured it into a clear capsule.

When you’re making cancer drugs at home, the measurements must be precise.

Mr. Zhang has no medical experience and no background in making drugs professionally. He did this out of desperation. His mother suffered from lung cancer and required expensive drugs that China’s ambitious but troubled health care system couldn’t provide.

He was aware of the risks. The drug he was making hadn’t been approved by regulators in China or the United States. Mr. Zhang had bought the raw ingredients online, but he wasn’t sure from whom, or whether they were even real.