Hospitals will need to post their standard charges for services, including the negotiated rates with insurers and the discounted price a hospital is willing to accept directly from a patient if paid in cash, administration officials said. Hospitals will also need to publish the same information for at least 300 "shoppable services," such as X-rays or lab tests.

The rule begins a "new era" in price transparency in health care, Health and Human Services Secretary Alex Azar told reporters on a conference call. "This shadowy system has to change. The patient has to be in control."

President Donald Trump is expected to discuss his transparency rules for hospitals and insurers Friday afternoon in a Roosevelt Room event.

The administration already requires hospitals to publish list prices, sometimes referred to as "sticker prices." That doesn't always reflect what someone with insurance might pay. The rule presented Friday, expected to be enacted in 2021, will go further by requiring hospitals to also post the prices paid by various insurance plans.

The Trump administration released a plan Friday that would force hospitals and insurers to disclose their negotiate rates or risk being fined.

Implementing the changes is likely to cost hospitals less than 1% of their revenue, an official on the call said. Hospitals could be fined $300 a day by the Centers for Medicare and Medicaid Services if they don't comply with the new disclosure rule, officials said. The administration is also proposing extending the disclosure rules to health insurers.

Hospitals and insurers have been criticized for keeping their negotiated rates a secret. The administration argues that forcing companies to disclose rates will empower patients, allowing them to find lower-priced alternatives. Some health-care groups, however, have said the rule is the wrong approach and could actually cause prices and premiums to rise.

Matt Eyles, president and CEO of America's Health Insurance Plans, said Friday that the group supports "clear, consistent and concise information that is customized to an individual's circumstances."

"Transparency should aid and support patient decision-making, should not undermine competitive negotiations that lower patients' health care costs, and should put downward pressure on premiums for consumers and employers," Eyles said.

The federal rule was expected to face legal challenges.

The American Hospital Association, an industry trade group, said later Friday it will join with member hospitals to file a legal challenge to the rule on grounds including that it exceeds the administration's authority.

Michael Abrams, the managing partner at health-care consulting firm Numerof & Associates, said hospitals could eventually come around to the idea of disclosing rates.

As far as the rule for insurers, Abrams said we'll have to wait and see.

"In the long term, this will have the effect of eliminating gross outliers, and forcing negotiated rates, more towards a more narrow band of prices which will tend, I think, to eliminate some of the differences between large hospitals and smaller ones," he said.

Shares of hospital stocks were slightly lower following the announcement. Health insurance stocks were flat on the news.

Trump's plan comes as health care remains a top issue for voters ahead of the 2020 presidential election. Trump and Congress are also trying to pass legislation before the end of the year that would bring more transparency to health-care costs and, ultimately, lower costs for consumers.

In October, Trump issued an executive order intended to bolster Medicare Advantage, private Medicare insurance for seniors.

--CNBC's Bertha Coombs contributed to this report.

WATCH: Pro says hospital price transparency won't impact earnings