Surrogacy is defined as “the practice by which a woman (called a surrogate mother) becomes pregnant and gives birth to a baby in order to give it to someone who cannot have children” (Merriam-Webster). Laws vary state to state as noted in this recent New York Times article.
In California, surrogacy is lawful (and regulated). The Family Code speaks about it here. In short, the parties enter into a contract whereby a woman will become pregnant via in vitro fertilization and birth a child that is not intended to be her own (nor is she genetically related to the child). She may enter into the contract with a married couple, those in a domestic partnership, or a single person. The contract needs to clearly spell out the terms including, but not limited to: the persons from which the egg and sperm came (unless anonymously donated) and the identity of the intended parent(s).
Be sure to speak to an experienced reproductive rights attorney before signing a surrogacy contract.