Route 9 close to Boston would be very unpleasant.
I have a Bikely route that goes from
Bedford to Northhampton. Amherst would be a slight variation from that. Beford is at the north-western end of the Minuteman Bikeway. So, get to Alewife station in Cambridge, and follow the Minuteman out to Bedford (~11 miles) then my route will get you to (or near) Amherst.
Speedo