Novel five organic donor-p-acceptor molecules (D-p-A) used for dye sensitized solar cells (DSSCs) and for organic solar cells (OSC), based on thienopyrazine and thiophene were studied by density functional theory (DFT) and timedependent DFT (TD-DFT) approaches to shed light on how the p-conjugation order influence the performance of the solar cells. The electron acceptor (anchoring) group was 2-cyanoacrylic for all compounds whereas the electron donor unit was varied and the influence was investigated. The theoretical results have shown that TD-DFT calculations, with a hybrid exchange–correlation functional using the Coulomb-attenuating method (CAM-B3LYP) in conjunction with polarizable continuum model of solvation (PCM) together with a 6-31G (d,p) basis set, was reasonably capable of predicting the excitation energies, the absorption and the emission spectra of the molecules. The frontier molecular orbitals (HOMO and LUMO) energy levels of these compounds can be ensuring positive effect on the process of electron injection and regeneration. The trend of the calculated HOMO-LUMO gaps nicely compares with the spectral data. In addition, the estimated values of open-circuit photovoltage (Voc) for these compounds were presented in two cases /TiO2 and /PCBM. The study of structural, electronics and optical properties for these compounds could help to design more efficient functional photovoltaic organic materials.