In the present work, the near edge X-ray absorption spectroscopy (NEXAFS) spectra at both C and N K-edges of pyridine, 2-fluoropyridine, and 2,6-difluoropyridine have been studied both experimentally and theoretically. From an electronic point of view, both transition potential density functional theory and time-dependent density functional theory approaches lead to reliable results provided that suitable basis sets and density functionals are employed. In this connection, the global hybrid B3LYP functional in conjunction with the EPR-III basis set appears particularly suitable after constant scaling of the band positions. For the N K-edge, vertical energies obtained at these levels and broadened by symmetric Gaussian distributions provide spectra in reasonable agreement with the experiment. Vibronic contributions further modulate the band-shapes leading to a better agreement with the experimental results, but are not strictly necessary for semi-quantitative investigations. On the other hand, vibronic contributions are responsible for strong intensity redistribution in the NEXAFS C K-edge spectra, and their inclusion is thus mandatory for a proper description of experiments. In this connection, the simple vertical gradient model is particularly appealing in view of its sufficient reliability and low computational cost. For more quantitative results, the more refined vertical Hessian approach can be employed, and its effectiveness has been improved thanks to a new least-squares fitting approach.