This work is aimed at development of a method of investigation into the chemical composition of natural and synthetic nitrogen-containing compounds using electron probe microanalysis (EPMA) and its application for identification of the form of inclusion of light elements (C, N, O) in complex anions and cations. The analysis was performed using Kα lines appearing upon electron transfer from valence 2p states to internal 1s states. The characteristic features of Kα spectra of C, N, and O, which affect the correctness of the EPMA results, were revealed, and adjustments accounting for integral line intensity, self-absorption of the nitrogen line, and absorption of background absorption by nitrogen were determined. The procedure is multifunctional: it is intended for analysis of various nitrogen-containing samples, including diamonds produced by detonation synthesis. The surface of such samples is usually coated with a layer of oxygen- and nitrogen-containing functional groups. The experiments are aimed at detection of the optimum conditions of excitation and recording of Kα lines. The applied accelerating voltage is 10 kV; the beam current is 50–120 nA. When analyzing the recording of the signal amplitude in the differential mode, we apply a universal (for all samples) empirical equation describing the curve of background intensity in the area of the nitrogen line. The resistance of samples against the action of the electron beam is improved by the raster mode with linear size of 20–40 μm and movement of sample in the area of ~100 × 100 μm2 (if allowed by sample size). The concentrations of the detected elements were calculated by the PAP program using Henke absorption coefficients. At 80 nA, the detection limits of carbon, oxygen, and nitrogen were 0.33, 0.46, and 0.86 wt %, respectively.