A couple of things can cause this. The spare tire and jack could be loose. or depending on what kind of rear suspension your vehicle has it could be a worn strut or control arm bushing.
More than likely you have something loose which is banging irregularly as a result. Also, an spare tire sitting in it's bed loosely will bang around as one is driving, especially over bumps.
This may be an exhaust problem in your vehicle. You may want to have the exhaust checked out from the manifold to the rear of the vehicle to make sure there isn't a problem.