A lawsuit filed Monday accused three makers of insulin of conspiring to drive up the prices of their lifesaving drugs, harming patients who were being asked to pay for a growing share of their drug bills.

The price of insulin has skyrocketed in recent years, with the three manufacturers — Sanofi, Novo Nordisk and Eli Lilly — raising the list prices of their products in near lock step, prompting outcry from patient groups and doctors who have pointed out that the rising prices appear to have little to do with increased production costs.

The lawsuit, filed in federal court in Massachusetts, accuses the companies of exploiting the country’s opaque drug-pricing system in a way that benefits themselves and the intermediaries known as pharmacy benefit managers. It cites several examples of patients with diabetes who, unable to afford their insulin treatments, which can cost up to $900 a month, have resorted to injecting themselves with expired insulin or starving themselves to control their blood sugar. Some patients, the lawsuit said, intentionally allowed themselves to slip into diabetic ketoacidosis — a blood syndrome that can be fatal — to get insulin from hospital emergency rooms.

A recent study in The Journal of the American Medical Association found that the price of insulin nearly tripled from 2002 to 2013.