The present paper concerns the investigation of the stress, temperature, and magnetic field in an isotropic homogeneous viscoelastic medium with a spherical cavity in a primary magnetic field, when the curved surface of the spherical cavity subjected to periodic loading. The generalized theory of thermoelasticity proposed by Green and Lindsay [J. Elasticity 2 (1972) 1] is applied to account for finite velocity of heat propagation. The numerical calculations are carried out for the displacement, temperature, the stresses and the perturbed magnetic field. The results are displayed graphically to illustrate the effect of relaxation times and magnetic field are very pronounced. Relevant results of previous investigations are deduced as special cases from this study. (C) 2003 Elsevier Inc. All rights reserved.