In the case of sunlight exposure to UVB an equilibrium is reached where the amount vitamin D produced in the skin equals the amount destroyed by UVB. This does not happen if you pop vitamin D pills. I've recently written an app that calculates the time required to obtain adequate vitamin D by lying prone in the sun, with most of your clothes off, and using MED the minimal erythema dose as a guide to safe sun exposure. At the height of summer it is a surprisingly short amount of time that is required to get adequate vitamin D even for people with dark skins.