A theory of the separation of a system of indirect excitons into a condensed and a gaseous phase with the formation of regular patterns of alternating phases in inhomogeneous external fields is developed. The model of spinodal decomposition of phase transitions, generalized for systems of unstable particles, is used. The theory is applied to the study of the non-uniform distribution of the exciton density in a double quantum well under a slot cut in a metallic electrode. It is shown that in a certain range of exciton generation rates a chain of light-emitting islands periodically localized along the slot is developed. With increasing width of the slot, the chain splits into two parallel chains shifted by a half period with respect to each other. By creating a biased external potential along the slot, the periodical pattern could be forced to move along the slot. The effect of the motion of the islands should manifest itself as time oscillations of the intensity of the light emitted from a fixed point.