  We study degenerate complex Monge-Amp\`ere equations on a compact K\"ahler
manifold $(X,\omega)$. We show that the complex Monge-Amp\`ere operator
$(\omega + dd^c \cdot)^n$ is well-defined on the class ${\mathcal E}(X,\omega)$
of $\omega$-plurisubharmonic functions with finite weighted Monge-Amp\`ere
energy. The class ${\mathcal E}(X,\omega)$ is the largest class of $\omega$-psh
functions on which the Monge-Amp\`ere operator is well-defined and the
comparison principle is valid. It contains several functions whose gradient is
not square integrable. We give a complete description of the range of the
Monge-Amp\`ere operator $(\omega +dd^c \cdot)^n$ on ${\mathcal E}(X,\omega)$,
as well as on some of its subclasses.
  We also study uniqueness properties, extending Calabi's result to this
unbounded and degenerate situation, and we give applications to complex
dynamics and to the existence of singular K\"ahler-Einstein metrics.
