From Wiki
Scenes were filmed at the old Medfield State Hospital in Medfield, Massachusetts. Scenes in Doctor Cawley's office were shot on the second floor of the chapel during the late evening; lights were shone on the windows to make it look like it was daytime. The surrounding brick walls in the outside hospital scenes were actually painted plywood which served the dual purpose of acting as scenery and blocking the set from view of a local road. Originally, scenes were going to be shot at the old Worcester State Hospital, but the filming would have gone on during the demolition of the surrounding buildings, which was impractical. Borderland State Park in Sharon, Massachusetts was used for the cabin scene. Peddocks Island was used as a setting for the story's island and East Point, in Nahant, Massachusetts for the lighthouse scenes.[8] Filming ended on July 2, 2008.[9]