The temperature dependence of Raman spectra of MgF2 has been studied in the range 12-1100 K. Detailed consideration of the B-1g phonon indicates that the (characteristic for the rutile-type crystals) anomalous softening with decreasing temperature is not associated with an incipient structural phase transition but with lattice contraction which alters the force constants. Combining the temperature data of this work and uniaxial stress Raman data [Pascual et al., Phys. Rev. B 24, 2101 (1981)], an anharmonicity analysis has been carried out in which the contributions of the volume thermal expansion and the pure temperature effects to the total observed frequency shifts have been determined and compared. These contributions are of the same sign (negative) for the A(1g) and E-g phonons, but of opposite sign for the B-1g phonon, with. the volume effect being dominant:in all cases in the range 200-1100 K, thus confirming the anticipated ionic character of the MgF2 bonds. An accurate expression valid for uniaxial tetragonal crystals was formulated and used for the calculation of the volume contribution and the results were compared to those obtained by the isotropic approximation. In the case of MgF2 for T>200 K, it was found that the two sets of data differ by only 5-15 % (depending on the phonon).