Massachusetts does not have a statewide standard for solar system design. The restrictions and regulations are on a per county basis, though the international fire code is a safe area to start.
This code says that panels must be at least 3 feet away from any ridge or rake. A ridge is where two slanted roofs meet. A ridge is also parallel to the ground. A rake is the angled edge of a roof at the end of the house. In some counties, panels are permitted to be right up against the ridges and rakes of a house.
The code also states that panels must be at least a foot and a half away from any hip or valley. A hip is where two slanted roofs meet at an angle to form a pointed slanted edge. Conversely, a valley is where two slanted roofs meet to form an inside angle. Some jurisdictions have no restrictions on hips and valleys.
The code also states that there is no restriction on how close panels can be to an eave, which is the lower edge of the roof. However, in some counties, panels must be at least 3 feet from the eaves of a house.
If your roof won’t allow for enough panels to offset your energy, you can pursue a ground mount if you have adequate available land on your property. Ground mounted systems, however, usually cost more than roof mounted systems.
Your installer will be well informed on this code for your county, however it’s important to know that certain restrictions may impact your system design.