Indium oxide doped with tin oxide, or ITO, has been widely used as an electrode material for flat panel displays. However, the rare metal in ITO is a limited natural resource. We succeeded in developing a material composed solely of elements with abundant reserves. We present the results of analyzing the electronic structure of an Mg-based compound based on its electrical conductivity. Mg-C thin films were prepared by sputtering method. A new transparent and electrically conductive material, Mg(OH)2-C, was formed after reacting the Mg-C film with moisture in air. On average, its transmittance of visible light was 90%. The mechanism for the effect of carbon on the electrical conductivity of Mg(OH)2 was examined on the basis of XPS spectra and DV-Xa molecular orbital calculations. The value of the band gap shows that Mg(OH)2 is an insulator. It was revealed that a new orbital appears when the number of substituting carbon atoms increases in the Mg(OH)2 lattice. It was possible to measure the new orbital that consisted of C-2s and C-2p. In addition, a comparison between the calculated electronic state around the valence band and the result measured by XPS of the obtained film reveals that they are in extremely close agreement.