The solution of the diffusion equation in spherical coordinates subject to time-dependent boundary conditions is derived. The solution can be employed to describe the growth of either a diffusion-controlled gas bubble or a heat transfer-controlled vapor bubble provided that convection effect is negligible. It is shown that the Epstein-Plesset solution for a gas bubble in a constant pressure field and the Jones-Zuber solution in a Cartesian coordinate system for a vapor bubble in a variable pressure field are special cases of the present solution. Numerical results obtained from the present analysis compare favorably with available experimental data for the growth of both gas and vapor bubbles during decompression processes.