We present a theory of superconducting p-n junctions. We consider a 2-band model of doped bulk semiconductors with attractive interactions between the charge carriers and derive the superconducting order parameter, the quasiparticle density of states and the chemical potential as a function of semiconductor gap $Delta_0$ and the doping level $varepsilon$. We verify previous results for the quantum phase diagram (QPD) for a system with constant density of states in the conduction and valence band, which show BCS-Superconductor to Bose-Einstein-Condensation (BEC) and BEC to Insulator transitions as function of doping level and band gap. Then, we extend it to a 3D density of states and derive the QPD, finding that a BEC phase can only exist for small band gaps $Delta_0 < Delta_0^*$. For larger band gaps, there is a direct transition from an insulator to a BCS phase. Next, we apply this theory to study the properties of superconducting p-n junctions, deriving the spatial variation of the superconducting order parameter along the p-n junction. We find a spatial crossover between a BCS and BEC condensate, as the density of charge carriers changes across the p-n junction. For the 2D system, we find two regimes, when the bulk is in a BCS phase, a BCS-BEC-BCS junction with a single BEC layer, and a BCS-BEC-I-BEC-BCS junction with two layers of BEC condensates separated by an insulating layer. In 3D there can also be a conventional BCS-I-BCS junction for semiconductors with band gaps exceeding $Delta_0^*$. Thus, there can be BEC layers in the well controlled setting of doped semiconductors, where the doping level can be varied to change the thickness of BEC layers, making Bose Einstein Condensates possibly accessible to experimental transport and optical studies in solid state materials.