Probability measures and Hamiltonian models on Bethe lattices. II. The solution of thermal and configurational problems