Gamma rays consist of photons that are produced when a nucleus from its excited state comes to its ground state releasing energy. Since gamma rays are chargeless and massless particles, the nucleus does not suffer any loss in mass during the gamma decay.