  We study a quantum extension of the spherical $p$-spin-glass model using the
imaginary-time replica formalism. We solve the model numerically and we discuss
two analytical approximation schemes that capture most of the features of the
solution. The phase diagram and the physical properties of the system are
determined in two ways: by imposing the usual conditions of thermodynamic
equilibrium and by using the condition of marginal stability. In both cases,
the phase diagram consists of two qualitatively different regions. If the
transition temperature is higher than a critical value $T^{\star}$, quantum
effects are qualitatively irrelevant and the phase transition is {\it second}
order, as in the classical case. However, when quantum fluctuations depress the
transition temperature below $T^{\star}$, the transition becomes {\it first
order}. The susceptibility is discontinuous and shows hysteresis across the
first order line, a behavior reminiscent of that observed in the dipolar Ising
spin-glass LiHo$_x$Y$_{1-x}$F$_4$ in an external transverse magnetic field. We
discuss in detail the thermodynamics and the stationary dynamics of both
states. The spectrum of magnetic excitations of the equilibrium spin-glass
state is gaped, leading to an exponentially small specific heat at low
temperatures. That of the marginally stable state is gapless and its specific
heat varies linearly with temperature, as generally observed in glasses at low
temperature. We show that the properties of the marginally stable state are
closely related to those obtained in studies of the real-time dynamics of the
system weakly coupled to a quantum thermal bath. Finally, we discuss a possible
application of our results to the problem of polymers in random media.
