WASHINGTON — The Supreme Court unanimously ruled on Tuesday that medical tests that rely on correlations between drug dosages and treatment are not eligible for patent protection.

Writing for the court, Justice Stephen G. Breyer said natural laws may not be patented standing alone or in connection with processes that involve “well-understood, routine, conventional activity.”

The natural law in question was the relationship between thiopurines, which are drugs used to treat gastrointestinal disorders, and metabolites in patients’ blood. Relying on its research into that relationship, Prometheus Laboratories patented a method to help doctors find the dose that is large enough to work and small enough to cause no needless harm.

After a unit of the Mayo Clinic developed its own test using slightly different correlations, Prometheus sued for infringement of its two patents for its method. Mayo responded that Prometheus was seeking to protect an abstract idea based on natural phenomena that was not eligible to be patented.