Shadow comes in two forms, form shadows and cast shadows. I talked about form shadowing in my last post, referring to the way light darkens around the form and finally terminates when the forms turn away from the light. That's a simple explanation, but the location of the terminus and the way the light falls off depends heavily on the light source.
Cast shadows are caused because photons striking one object (and being absorbed or deflected) necessarily can't pass through that object. So if you can trace a line through space from the light source to the edges of the object, you'll know exactly the shape of the shadow being cast onto objects behind it. Again, that's an overly simple explanation because like form shadows, cast shadows depend a lot on the light source.
So let's look at how light sources affect form shadows and cast shadows. For most lighting schemes, you will use one of three light types: Spotlights or distant sources, nearby sources, and large or diffuse sources.
Spotlights, Sunlight, and Distant Sources
These lights give you soft-edged form shadows but hard-edged cast shadows, because the photons are essentially flying parallel because of the distance from the source. Remember to think in three dimensions to work out where the shadows fall!
As light sources approach an object, the cast shadow grows in size and the terminator approaches the light source (to the point where the planes on the object are parallel to the photons travelling from the light). Remember that any other objects around the light will have a different center light location and terminator. If the light source is small then the cast shadow will be hard-edged. This is the hardest light source to paint!
Large or Diffuse Sources:
The larger the light source is (relative to the object) the more the terminator moves away from the light source and the softer-edged the shadow becomes. This is because A) light radiates in every direction from everywhere on the source and B) only portions of the light source are effective as you approach the area behind the object, since the object is blocking photons from getting through to that area.
Finally, remember that cast shadows aren't black---they're filled with light from the rest of the environment. Sometimes in complex lighting situations, I figure out what the object looks like under the main light source before I paint in the main source, and that helps my cast shadows feel more true to the scene.