Or to simplify (for the non-math majors out there like me )... the aperture is equal to the diameter of the lens opening divided into the focal length. 25mm lens opening on a 50mm lens equals f/2.0 (50/25 = 2).
Since every lens increases in focal length when focus from infinity to the closest distance, and since the lens opening remains constant, the aperture becomes smaller relative to the focal length. On standard (non-macro lenses), this is negligible.
The macro lenses allow extreme close focusing and the extension for any focal length needed to get to 1 to 1 is equal to the focal length. 50mm of extension is needed to allow a 50mm lens to focus to life-size. So now, that same 25mm lens opening is applied to a lens much longer than a 50mm lens, making for a two-stop loss of aperture (100/25 = 4).
All modern cameras read the actual light coming through the lens, so this is taken into account for any TTL metering. Newer cameras with LCDs will allow you to see the actual aperture shift digitally read-out while focusing. The only time you need to do any math is when you are doing close-up work with a non-TTL camera.