In case you have the beginnings of arthritis it wouldn't hurt to start taking a daily dose of glucosamine with chondroitin, could stop any deterioration before it causes any pain.
I take a vitamin C packet from emergen-C that has the above in and supplement with a liquid from Swanson (online vitamins). Get in the habit and hopefully you'll have healthy joints for a long time.
Chance are, if you have healthy joints, the cracking sound is the result of gas escaping as you move your joint.
Another cause can be ligaments moving across your joints and "snapping" back into position.
If you have arthritis, it is possible that the sound comes from the rough joint surface if you have lost cartilage.