Hospitals across the nation -- even those located just miles apart -- charge wildly different rates for the same medical procedure. A data set released for the first time by the Department of Health and Human Services illustrates just how dramatic the price gaps can be.

The database, released Wednesday, is based on bills submitted by more than 3,000 U.S. hospitals nationwide for Medicare patients they treated. It covers the 100 most common in-patient procedures for those patients.

Encompassing more than 163,000 separate records, the data set will be a gold mine for researchers analyzing the often inscrutable field of health care pricing. Through standardized diagnostic codes, it allows comparisons for similar services provided by different hospitals.

For example, the average bill for treatment for a heart attack without major complications at a hospital in Danville, Ark., was $3,334. Across the country in Modesto, Calif., the same diagnosis incurred an average bill of $92,057.

Even within the same region, costs can run to opposite extremes. HHS pointed out that the bills submitted for treating heart failure with some complications ranges from a low of $21,000 to a high of $46,000 in Denver, Colo., and from a low of $9,000 to a high of $51,000 in Jackson, Mississippi.

Like most private insurance companies, Medicare rarely pays the full bill a hospital submits. It uses a standardized formula to reimburse providers that accounts for a variety of cost factors. The Modesto hospital that submitted bills topping $92,000 actually collected an average reimbursement of $6,023 per patient.

But the uninsured and underinsured can be responsible for posted charges at the hospital, leaving them deeply in debt after to their treatment. And finding out how much the same procedure costs at different hospitals can be very difficult for those patients.

Related: Millions can't afford to go to the doctor

"This new data will shine a light on differences in what hospitals charge," Marilyn Tavenner, acting administrator of HHS' Centers for Medicare and Medicaid, said in a prepared statement.

Only about 6% of hospital patients actually pay their own bills and are thus subject to the pricing in this report, according to David Sadoff, head of the US health care provider practice at Boston Consulting Group. And even some patients who pay out of pocket are more inclined to be treated at the hospital where their doctor is based, rather than where the costs are lowest. But he said the more transparency that can be introduced into health care pricing, the better.

"I think this is a good first step," Sadoff said. "Is it going to change most patients' lives tomorrow and how they pick a hospital? Probably not."

HHS hopes researchers will repackage its data. The Robert Wood Johnson Foundation (RWJF), a nonprofit focused on public heath issues, is planning a contest for user-friendly illustrations of the information, and various news organizations have created their own explorations. A New York Times map lets readers drill into the data by zip code.

HHS also announced that it is making $87 million available to states to create health care data centers to collect and publish local pricing information. Those centers are intended to help consumers better understand the comparative prices of services in their area.