The mass composition of cosmic rays with primary energies between 1014 eV and 1016 eV has been studied using the surface and buried scintillators of the CASA-MIA air shower array. Near 1014 eV, the composition of cosmic rays is in agreement with direct measurements, roughly half light elements (protons and helium) and half heavier elements. The average mass increases with energy, becoming heavier above 1015 eV. The mass changes coincide with the spectral steepening of the energy spectrum known as the knee. There is evidence for rigidity dependence in the spectral change. A method of calculating the primary cosmic ray energy which is insensitive to the composition is employed to achieve these results.