There are several common muzzle devices:
Flash Hider: a metal cone that shields the user from much of the muzzle flash.
Flash Suppressor: A device, usually with slots parallel to the bore, used to disrupt the muzzle flash.
Muzzle Brake: A device which redirects muzzle gasses (and therefore also the blast and flash) by using holes or flat panels perpendicular to the bore, usually on the sides. The gasses hit these holes or flats at high speed, where they are redirected, causing a "forward push" on the muzzle brake. This counteracts some of the rearward motion caused by the recoil of the gun, and reduces felt recoil. Some rifles, such as virtually all .50BMG rifles, would not be shootable from the shoulder without a muzzle brake. Many muzzle brakes are also designed to be compensators.
Muzzle Compensator (Comp): A device which has holes or flats on the top, which redirects muzzle gas upward. This reduces the tendancy of the muzzle to flip up while shooting. Compensators are especially popular with action pistol shooters.
Legal note: Flash hiders, flash suppressors, and devices that are 22mm in diameter are legal only on pre-ban AR15 rifles (configured with detachable magazines and pistol grips). Brakes and Comps can be used on either pre-ban or post-ban AR15s, but on a post-ban, they cannot use muzzle threads that would also allow the mounting of a flash suppressor. They are typically press-fit and pinned in place, or threaded on and welded in place, when used on a post-ban rifle.
-Troy