It is known that the spectral radius (with respect to the Haar measure) of a random walk on a group is one if and only if the group is amenable. We prove a similar result for some cocycle even when the spectral radius is < 1, for a non-necessarily invariant kernel. We also prove that there exist slow diffusions (the spectral radius is one) in random media on a tree.