The first thing to remember is that in crystallising your protein, you are actually precipitating it. However, the key thing here is that it is an ordered precipitation, rather than the disordered precipitation you see when you get your buffer pH wrong.
The basic techniques utilise the addition of different precipitating agents to an aqueous protein solution while avoiding denaturation. The use of these agents has been perfected on a trial-and-error basis over several decades, and numerous commercial 'screens' representing wide ranges of precipitants, buffers, ionic strengths and various additives are available.
These screens (typically containing 96 conditions each) take one of two formats.
'Sparse Matrix' screens use seemingly random conditions that have been built up from the literature - these conditions have successfully crystallised many proteins in the past and have resulted in many depositions to the PDB. The JCSG screen is a good example and is often the starting screen of choice for many crystallographers.
'Grid Screens' take a few key components and systematically vary their concentrations to find ideal points in 'crystallisation space'. Typically, a few popular PEGs (Polyethylene glycols - common protein precipitants) are varied in concentration along with several different salts. In some screens the pH is varied as well. The PACT screen is a popular 'Grid Screen' which complements the JCSG screen above in a first round of crystallisation experiments.