People in Spencer were advised not to use or touch the water until further notice, said Ed Coletta, a spokesman for the state Department of Environmental Protection.
Residents started complaining of skin irritation and moderate burns after showering early Wednesday, police Sgt. John Agnew said. He said officials determined that a malfunction at the town's water treatment plant had released too much sodium hydroxide into the water supply.
Sodium hydroxide, also known as lye, is routinely put into water to reduce acidity and limit pipe corrosion, Coletta said.
The Spencer Fire Department took about 40 people to area hospitals who have displayed rashes or burns, said firefighter Ryan Flannery.
The DEP advised residents to discard any liquids or foods made with town water on Tuesday or Wednesday.
Spencer Town Manager Carter Terenzini said that as of 11:30 a.m., about 12 people were undergoing "decontamination" treatment at St. Vincent's hospital in Worcester. He did not know whether those people drank the water, or if it came in contact with their skin.
The excess chemicals were expected to be removed by this evening and the water supply would be subject to extensive environmental testing, Terenzini said.
Flannery said local bottled water companies have dropped off drinking water for pickup at the fire station. Officials were devising plans to deliver drinking water to those who can't get to the fire station, he said.
Spencer has about 12,000 residents and is about 10 miles west of Worcester.