Spectrally resolved two-dimensional imaging of ultrashort laser-produced plasmas is described, obtained by means of an advanced technique. The technique has been tested with microplasmas produced by ultrashort relativistic laser pulses. The technique is based on the use of a pinhole camera equipped with a charge coupled device detector operating in the single-photon regime. The spectral resolution is about 150 eV in the 4-10 keV range, and images in any selected photon energy range have a spatial resolution of 5 microm. The potential of the technique to study fast electron propagation in ultraintense laser interaction with multilayer targets is discussed and some preliminary results are shown.