When a droplet of a soft matter solution is dried, cavities are often formed in the droplet, giving a hollow sphere in the end. A theoretical model is given for this phenomenon. It is shown that the formation of a gel-like layer (skin layer), which has a finite shear modulus, is essential for the phenomenon to take place. The condition for cavity formation (how it depends on the shear modulus and thickness of the skin layer), and the variation of the droplet volume and cavity volume after the cavity formation are examined.