The origin of the light distribution in spiral galaxies