  After reviewing the basics of the cavity method in classical systems, we show
how its quantum version, with some appropriate approximation scheme, can be
used to study a system of spins with random ferromagnetic interactions and a
random transverse field. The quantum cavity equations describing the
ferromagnetic-paramagnetic phase transition can be transformed into the
well-known problem of a classical directed polymer in a random medium. The
glass transition of this polymer problem translates ino the existence of a
`Griffith phase' close to the quantum phase transition of the quantum spin
problem, where the physics is dominated by rare events.
