The marfe is studied as a radiative thermal instability in a two-dimensional axisymmetric tokamak model. To obtain a detailed idea of the marfe onset, a linear analysis is performed, using a full set of magnetohydrodynamic equations. Some typical marfe shots from JET are simulated. It is demonstrated how the marfe is a result of a poloidally symmetric temperature decrease and an asymmetric density increase. It is found that the onset of the marfe is accompanied by significant perturbations of pressure and magnetic field. The evolution of the marfe is discussed, based on the linear results. The model proves to give not only qualitative, but also quantitative agreement. The plasma parameters for marfe onset can be predicted accurately. Thermal instabilities belong to a continuum in the MHD spectrum of eigenfrequencies. The thermal stability of an equilibrium can be tested very easily by calculating this continuum.