Freehub Bodies
The freehub body is part of most quality modern rear hubs. The freehub body (1) connects the rear gears to the hub and (2) allows the bike to freewheel (coast without having to crank the pedals).
Shimano Freehub Body, with Connecting Bolt to Left

The rear gears are called the cogset. Cogsets that slide on freehub bodies are called cassettes. Cassettes are different from freewheels, which connect the hub by screwing them on. For more details, link to Rear Gears--Freewheels and Cogsets.
The freehub body contains a ratchet--a notched bar, with spring loaded pawls to prevent reversal of motion. When you push on the pedal, the pawls engage the ratchet and transfer power to make you go forward. When you coast, the pawls slide over the ratchet allowing you to coast without moving the pedals--freewheeling. When you coast, the clicking you hear is the pawls slipping off the ratchet teeth and clicking against the bottom.
Freehub bodies are not reparable. If one doesn't work, it has to be replaced.
Manufacturers put grease in the freehub body. Some freehub bodies have a grease port that allows you to add more lube, but most don't. Don't apply a penetrate (such as WD 40) into a freehub body, because it will eat up the grease. Try to keep your freehub body away from water, salt and grit.
You know your freehub body is toast when the pedals keep moving when you coast.
Freehub bodies sometimes creak and click when they shouldn't. It is hard to tell what component is creaking--pedals, bottom bracket, crank set, chain, wheels, freehub body ... .
To inspect the freehub body, remove the cassette and clean everything you can reach. Wiggle the freehub body with your fingers. It should move a little bit laterally, but not very much. A loose freehub body, or one which does not freewheel smoothly and freely should be replaced.
Tools to replace a freehub body:
chain whip
large adjustable wrench
cassette removal tool
large hex wrench (usually 10 mm) with a long handle
possibly a small diameter pipe to use as a lever
The procedure to replace a Shimano freehub body is:
1. Remove the rear wheel from the bike.
2. Take off the quick release device.
4. Remove the rear axle. (You have to overhaul the rear hub.)
5. Put the (usually) 10 mm hex wrench inside the freehub body from the drive side. Make sure it is securely seated in the hex-shaped hollow bolt that is inside the freehub body, connecting it to the main hub body. Hold the wheel steady, and loosen the hollow bolt by rotating counterclockwise (as you are looking down at the wheel from the drive side). It may take gargantuan force--that's why you might need a small diameter pipe to use as a lever.
10 mm Allen Wrench in Shimano Freehub Body
6. Clean everything you can reach.
7. Lightly grease the threads of the bolt.
8. Install another freehub body by reversing step 5. Tighten snugly.
10. Replace the wheel. Check the brake and derailleur adjustment.
Non-Shimano hubs may have way different procedures.
Shimano freehub bodies come in 2 lengths--7 speed and 8 plus speed. If you have a 7 speed bike, but can only buy an 8 plus speed freehub body (or hub or wheel), a spacer is available that will make your cassette fit the longer freehub body.
Most brands are compatible with Shimano freehub bodies. Sram cassettes work nicely. However, Campagnolo hubs need Campagnolo cassettes.