Theory of the spatially resolved optogalvanic effect in a CO-discharge positive column is given. The theory has been found to agree well with experimental results. Based on this theory, a new method for measuring spatial distributions of electron density (or gain) in positive columns of discharge by means of optogalvanic effects is proposed.