I present details of the first principle theory of X-ray spectral formation in neutron star (NS) and black hole (BH) binaries. I show this theory predicts the spectral index correlation vs mass accretion rate as in the case of NS as well in the BH case. In both cases this index correlation is mostly correlated to the ratio of energy release in the disk vs that in transition (boundary) layer. In BHs the spectral index should increase and then saturate with mass accretion rate because the index as an inverse of Comptonization parameter Y and Y-parameter saturates with the high mass accretion in the converging flow onto BH. Comparison of this model prediction with X-ray observations shows that in BH case the index, indeed, correlates and then saturates with mass accretion rate. Moreover this index-mass accretion rate correlation allows us to estimate BH masses and distance to the source. While in NS sources the observations shows that the index stays the same independently of spectral state of the source which can be possible if the energy release in the disk is always much smaller of that at NS TL (boundary layer).