Is your chain too loose? You say it sounds like the chain hitting something,have you investigated that fully? How many miles on your bike? If it does it at a coast with the engine off, it has to be either the drive system(chain and sprockets) or something with one of your wheels. May be brake related too but you could elimate that by applying the brakes individually to see if the noise changes or stops.

Noises can be hard to track sometimes.. especially on a bike but keep after it and narrow it down.. you'll find it.