A "freebase" is merely one form that many drugs can take, the other being a "salt". The salt is formed by acidifying the drug, whereas the freebase is made by basifying the drug. Most drugs can be made into a freebase by dissolving in water and heating with baking soda until the water evaporates/boils off. It should be noted that many freebases are oils, not solids (and any solids remaining are salt or unreacted baking soda, the latter of which breaks down to CO2 when heated, pretty harmless).
Most psychoactive drugs are considered "alkaloids", which merely means that somewhere in the molecule is an "amine" group (a nitrogen group with hydrogens and/or carbons attached to it with single bonds). Nitrogen 'likes' to make three bonds (in order to fill out its electron shell). It can also make an additional (fourth) bond, however this will leave the nitrogen positively charged (no longer full electron shell as it has to share some electrons in the bond). Typically, this extra bond is made by a hydrogen atom.
Molecules containing nitrogens are usually basic. This means, in solution, hydrogen ions (H+) will much prefer to bond to the nitrogen than to remain in solution. Acidic solutions (pH <7) have lots of hydrogen ions (H+) along with some balancing ion (Cl-, Br-, HCOO-, etc). Say you take an alkaloid, 5-MeO-DIPT for instance, and drop it into an acidic solution, say water with some hydrocloric acid (HCl), the extra hydrogens in the acidic solution will bind to the amine making it positively controlled. The chlorine ions (Cl- from the HCl) will then be attracted to the charge to balance it out. You will now have the "HCl salt" of 5-MeO-DIPT. If you were to take this salt, put it into a basic solution (water with something that likes hydrogens even more than 5-MeO-DIPT), the extra hydrogen would be removed by the stronger base leaving the 5-MeO-DIPT as a "freebase" (no extra hydrogens attached).
Most alkaloids are prepared as a salt, because the freebase often is difficult or will not crystallize (typically an oil). This can be problematic for measuring out accurate dosages, thus salts are preferred in this sense. However, the salt form of many compounds has a much higher melting/vaporization point than the freebase (or freeacid if its got an acidic group instead of the basic amine group).
Because of this difference in vaporization point, the freebase is often preferred. The most common street preperation for a freebase is the method for making crack cocaine, which is to heat the cocaine-HCl powder with some baking soda (sodium bicarbonate, a weak base) and water until the water boils off. The downside of this method is that you're left with a mixture that is not pure cocaine freebase. The reasons its used, however, is that it doesn't involve volatile solvents and is safer & easier.
A more chemically inclined person would possibly dissolve the salt in a minimum amount of water (possibly slightly acidic to aid solvation), then basify the solution with a strong base (NaOH, KOH, etc.) to at least pH 10, then extract with a non-polar solvent (chlorofom, dichloromethane, ether, etc. which is well checked beforehand to ensure no residue left after the solvent evaporates). The solvent is then dried and evaporated. One of the reasons that home freebase coke and meth labs are so dangerous is due to improper procedure in storing and evaporating solvents. Many volatile solvents are also extremely flammable and people die from fires and explosions.
For more information about how crack is made, read this Ask Erowid Question.