We present a procedure for the characterization and the linearization of the photoresist response to UV exposure for application to the gray-scale fabrication of diffractive optical elements. A simple and reliable model is presented as part of the characterization procedure. Application to the fabrication of surface-relief diffractive optical elements is presented, and theoretical predictions are shown to agree well with experiments.