We give an explicit bound on the spectral radius in terms of the densities of short cycles in finite d-regular graphs. It follows that the a finite d-regular Ramanujan graph G contains a negligible number of cycles of size less than cloglog| We prove that infinite d -regular Ramanujan unimodular random graphs are trees. Through Benjamini.Schramm convergence this leads to the following rigidity result. If most eigenvalues of a d-regular finite graph G fall in the Alon.Boppana region, then the eigenvalue distribution of G is close to the spectral measure of the d-regular tree. In particular, G contains few short cycles. In contrast, we show that d-regular unimodular random graphs with maximal growth are not necessarily trees.