There are over 7,000 rare diseases, and over 90 percent have no F.D.A.-approved treatment, according to Rachel Sher, vice president of regulatory and government affairs at the National Organization for Rare Disorders.

Tens of thousands of patients could be in Mila’s situation in the United States alone. But there are nowhere near enough researchers to make custom drugs for all who might want them.

And even if there were, who would pay? Not the federal government, not drug companies and not insurers, said Dr. Steven Joffe, professor of medical ethics and health policy at the University of Pennsylvania.

“Unfortunately, that leaves it to families,” he added. “It feels awfully uncomfortable, but that is the reality.”

That means custom drugs would be an option only for the very wealthy, those with the skills to raise large sums of money, or those who gain the support of foundations.

Mila’s drug development was mostly paid for by the foundation run by her mother, but she and Dr. Yu declined to say how much was spent.

The idea of custom drugs also leads the F.D.A. into uncharted territory. In an editorial published with Dr. Yu’s paper, Dr. Janet Woodcock, director of the F.D.A.’s Center for Drug Evaluation and Research, raised tough questions:

What type of evidence is needed before exposing a human to a new drug? Even in rapidly progressing, fatal illnesses, precipitating severe complications or death is not acceptable, so what is the minimum assurance of safety that is needed?

She also asked how a custom drug’s efficacy might be evaluated, and how regulators should weigh the urgency of the patient’s situation and the number of patients who could ultimately be treated. None of those questions have an easy answer.