There can be a number of causes for this, not least of which may be a defective memory card. Usually the images can be rescued via image retrieval software, but this can be time consuming. Formatting a card, on the other hand, may prevent the problem in the first place. First of all, it's important to format a brand new card before using it in your digital camera. It sets up the card so that it, and the camera, communicate with each other correctly. And it only takes a few seconds.
Go ahead and pop your brand-new memory card into your camera. From the camera's menu, look for the "format" function (every digital SLR camera will have this function) and hit "ok" or "go" to open it -- the open command itself will vary from camera to camera, so refer to your manual if you're not familiar with this.
You'll see immediately that you also get a "cancel" feature, which lets you opt out of this function. That's important, because formatting will permanently erase all the images you may have on this card if you've already been using it. Not an issue, of course, if the card is brand new, but certainly an important feature to remember. You don't want to accidentally wipe out your images before you've downloaded them.

To re-cap: always format a new memory card. Personally, I always re-format my card before re-using it as well (instead of just deleting the photos from it) but of course, be sure that those photos have been safely downloaded first.
Do you think this will be helpful? Drop me a line! dhutt@dmddigitalphoto.com