The first is the prestellar phase, when a particularly dense region of a molecular cloud first begins to clump together and second phase called the protostar, when gravity has pulled enough material together to form a dense, hot core out of the surrounding envelope.