TRENTON  The New Jersey Legislature approved a measure on Monday that would make the state the 14th in the nation, but one of the few on the East Coast, to legalize the use of marijuana to help patients with chronic illnesses.

The measure  which would allow patients diagnosed with severe illnesses like cancer, AIDS, Lou Gehrig’s disease, muscular dystrophy and multiple sclerosis to have access to marijuana grown and distributed through state-monitored dispensaries  was passed by the General Assembly and State Senate on the final day of the legislative session.

Gov. Jon S. Corzine has said he would sign it into law before leaving office next Tuesday. Supporters said that within nine months, patients with a prescription for marijuana from their doctors should be able to obtain it at one of six locations.

“It’s nice to finally see a day when democracy helps heal people,” said Charles Kwiatkowski, 38, one of dozens of patients who rallied at the State House before the vote and broke into applause when the lawmakers approved the measure.