From the MBTA website:
Getting to the Starting Line: The Boston Marathon begins on East Main Street in Hopkinton, Massachusetts. Official Marathon participants should note that the only guaranteed mode of transportation on the morning of the race is the authorized Boston Athletic Association buses that load on the Tremont Street-side of the Boston Common. This area is easily accessed via the Green Line at Boylston Street Station, the Green and Red Line at Park Street Station, the Orange Line at Chinatown Station, the Orange and Red Line at Downtown Crossing Station, and the Orange and Blue Line at State Station.
For more starting line information for Marathon runners and a full course map of the Boston Marathon, visit the Boston Athletic Association’s Boston Marathon website.
Marathon fans and spectators can take the Framingham/Worcester Line Commuter Rail from the Downtown Boston area at South Station or Back Bay Station to Framingham Station.
Getting to the Finish Line: The course of the Boston Marathon finishes on Boylston Street near the John Hancock Tower and the Boston Public Library in Downtown Boston’s Copley Square area. Fans and participants should note that Copley Station is CLOSED during the day of the Boston Marathon. Using the T to get to the finish line is the easiest transportation option with convenient Green Line stops at Hynes Convention Center Station and Prudential Station as well as the Orange Line and Commuter Rail stop at Back Bay Station.
For a full course map of the Boston Marathon, visit the Boston Athletic Association’s Boston Marathon website.