Theory of the phase diagram of highly excited semiconductors