Inhomogeneous light shift in alkali-metal atoms