We study degenerate complex Monge-Ampere equations on a compact Kahler manifold (X, omega). We show that the complex Monge-Ampere operator (omega + dd(c).)(n) is well defined on the class epsilon(X, omega) of omega-plufisubharmonic functions with finite weighted Monge-Ampere energy. The class epsilon(X, omega) is the largest class of omega-psh functions on which the Monge-Ampere 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 operator (omega + dd(c).)(n) on epsilon(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 Kahler-Einstein metrics. (C) 2007 Elsevier Inc. All rights reserved.