This is one reason why we have the patent structure, so people can publicly disclose data for validation purposes and still make a substantial profit.
Plus the clinical trial process is extensive. It would be much harder in the present regulatory regime to have a new BS prescription drug than a new BS testing startup, like this one or Theranos. (Old drugs are a little different - some were grandfathered into the current testing regime and evidence for their effectiveness is in some cases limited.)
Certainly there are trade secrets in medicine, but not everywhere.
As a result, the medical industry is less competitive than other industries. Also, it’s seen as ethically dubious to compete on saving lives. Instead, there’s a lot if in-licensing deals (see above re patents) as opposed to trade secrets.