But manipulating a gene to create something not found in nature, Justice Thomas added, is an invention eligible for patent protection.
He also left the door open for other ways for companies to profit from their research.They may patent the methods of isolating genes, he said.
"But the processes used by Myriad to isolate DNA were well understood by geneticists," Thomas wrote.
He added that companies may also obtain patents on new applications of knowledge gained from genetic research.
The patents were challenged by scientists and doctors, who said their research and ability to help patients had been frustrated.
The particular genes at issue received public attention after the actress Angelina Jolie revealed in May that she had had a preventive double mastectomy after learning that she had inherited a faulty copy of a gene that put her at high risk for breast cancer.
The price of the test, often more than $3000, puts it out of reach for some women, and is partly due to Myriad's patent.
The company filed patent infringement suits against others who conducted testing based on the gene.
In Australia, Myriad has granted an exclusive licence to the patent to a company called Genetic Technologies Limited.
In 2008, Genetic Technologies attempted to enforce its patent rights over the gene, and threatened pathology and cancer centres with legal action.
After a public backlash, it did not follow through with its threat, and while Myriad has actively defended the case in Australia, Genetic Technologies has not.
Sign up for MIS Asia eNewsletters.