The Senate on Thursday passed a bill that could improve patients' chances to gain access to experimental drugs that have not been approved by the Food and Drug Administration but are in clinical trials.

The right-to-try legislation passed through unanimous consent, with no senators objecting to it.

"By passing the Trickett Wendler, Frank Mongiello, Jordan McLinn, and Matthew Bellina Right to Try Act of 2017 today, the Senate took a strong stand in support of the millions of Americans and their families suffering from terminal illnesses," said Sen. Ron Johnson, R-Wis., in a statement. Johnson was the lead sponsor of the legislation.

The bill would allow terminally ill patients the right to try experimental treatments that have not been approved when no alternatives exist. A manufacturer or prescriber couldn't be sued for providing the experimental drug.

Johnson had tried to add the bill to a legislative package reauthorizing the FDA's user fee program, and said earlier this year he would have objected to any measures to fast track the reauthorization legislation. However, he struck a deal with leadership for a separate vote on the bill.

The bill isn't the only legislation aimed at expanding access to experimental drugs. The FDA user fee package contains legislation to require the agency to look at the eligibility criteria for trials and hold a meeting on potential barriers to participation. Some of those barriers include the distance and cost of getting to a trial.