We introduce a method to experimentally measure the monochromatic transmission matrix of a complex medium in optics. This method is based on a spatial phase modulator together with a full-field interferometric measurement on a camera. We determine the transmission matrix of a thick random scattering sample. We show that this matrix exhibits statistical properties in good agreement with random matrix theory and allows light focusing and imaging through the random medium. This method might give important insight into the mesoscopic properties of a complex medium.