Check out xritephoto.com for the ColorChecker (a product name, not a generic term). The CC is used to make color profiles, which automatically correct colors for a given spectrum of light. This works only in Lightroom, and I think OnOne, but not Aperture or any generic software. It also serves as a WB target in post or in camera, with color patches serving as known references and as warming or cooling patches. To use these features, you use the white balance tool in your software to select a neutral patch on the card in an image you took (usually a reference image).
A gray card can work similarly, but only if it's spectrally neutral. Some gray cards are not neutral enough for WB. The new ones from Xrite are. Some people use gray cards for exposure since they're supposed to be 18% gray, or whatever the accepted number is, but this is not a very accurate method in my experience. When using a card for WB in camera, follow the camera's procedures for taking a photo of the card and using it as a reference image for white balance. Exposure must be correct or it could influence the color cast.