We consider a perfectly homogeneous and isotropic universe which undergoes a sudden phase transition. If the transition produces topological defects, which we assume, perturbations in the geometry and the cosmic fluid also suddenly appear. We apply the standard general relativistic junction conditions to match the pre- and post- transition eras and thus set the initial conditions for the perturbations. We solve their evolution equations analytically in the case when the defects act as a coherent source and their density scales like the background density. We show that isocurvature as well as adiabatic perturbations are created, in a ratio which is independent of the detailed properties of the defects. We compare our result to the initial conditions currently used in the literature and show how the cosmic fluid naturally "compensates" for the presence of the defects.