Ayer is a town in Middlesex County, Massachusetts. It was incorporated in 1871, and became a bustling commercial railroad junction. Its population at the 2010 census was 7,427.
Despite its relatively small area Ayer has numerous industries, including plants belonging to Cains, and Pepsi, a historical downtown unique to the region, and modern commuter rail service to Boston. A number of structures in Ayer are listed on the National Register for Historic Places.
The population predominantly comrpises White Americans. A small percentage of the population comprises African Americans, and people of Hispanic origin.