We show that the negative of the number of {ital floppy modes} behaves as a {ital free energy} for both connectivity and rigidity percolation, and we illustrate this result using Bethe lattices. The rigidity transition on Bethe lattices is found to be first order at a bond concentration close to that predicted by Maxwell constraint counting. We calculate the probability of a bond being on the infinite cluster and also on the overconstrained part of the infinite cluster, and show how a {ital specific heat }can be defined as the second derivative of the free energy. We demonstrate that the Bethe lattice solution is equivalent to that of the random bond model, where points are joined randomly (with equal probability at all length scales) to have a given coordination, and then subsequently bonds are randomly removed. {copyright} {ital 1999} {ital The American Physical Society}