|MadSci Network: Cell Biology|
As you might expect, it's rather complicated and the process is not understood completely. However, turning a gene on involves recruiting a lot of proteins (called transcription factors) to a small region of DNA at one end of the gene. Some genes can only be turned on when a specific combination of factors is present, and this combination only occurs in certain cell types. These genes are "off" in all other cells. There are other aspects to turning genes on and off, however. DNA normally is packaged up with a lot of proteins inside of the cell's nucleus. The way the DNA is packaged can prevent the transcription factors from finding a gene. The organization of genes along the DNA strand can determine whether a given gene is wrapped up and hidden away (off), or whether it remains accessible to transcription factors (on). Thus, genes are controlled by more than one mechanism.
Try the links in the MadSci Library for more information on Cell Biology.