Photocatalytic systems based on fluorine- and nitrogen-doped titanium dioxide were obtained via the sol–gel method. Titanium tetraisopropoxide and ammonium fluoride were used as precursors. Transmission electron microscopy and measurement of Brunauer–Emmett–Teller surface area and porosity were used to establish that the concentration of ammonium fluoride has an impact on the structural parameters of titanium dioxide produced in the sol–gel process. X-ray photoelectron spectroscopy and Fourier transform infrared spectroscopy revealed that the dopants (F and N) are not incorporated into the crystal lattice of titanium dioxide, but affect the optical properties of titanium dioxide due to the emergence of additional bands in the absorption spectra in the range of 380–450 nm. Sorption and photoactivity were found using methylene blue photodecomposition under visible light. It was found that dopant introduction increases both sorption ability and photoactivity of the materials.