Photodissociation by vacuum ultraviolet (VUV) photons is one key destruction pathway for small C-bearing molecules in the diffuse interstellar medium (ISM) and photon-dominated regions (PDRs). Wavelength-dependent photodissociation cross sections and atomic product branching ratios are essential to accurately simulate the chemical evolution in those environments. However, for transient molecules, considerable uncertainty still exists about those data in modern astrochemical models because studies in the VUV energy range are quite challenging both experimentally and theoretically. Here we present high-level ab initio studies of the highly excited Rydberg and valence states of two molecules, CS and C2, and their photodissociation from the electronic ground state. Both molecules have been detected in space, and predissociation of the C1Σ+ state of CS and the F1Πu state of C2 is considered to be important for their photodissociation based on previous studies. Potential energy curves of CS and C2 electronic states were calculated at the SA-CASSCF/MRCI+Q level using Dunning basis sets with additional diffuse functions. To represent the Rydberg nature of those highly excited states, the active space consisted of several additional σ orbitals for CS and σg orbitals for C2 beyond the valence orbitals. A total of 49 potential energy curves for CS and 57 states for C2 were calculated, as well as related transition dipole moments, nonadiabatic coupling matrix elements, and spin-orbit couplings. Then photodissociation cross sections from the electronic ground state were calculated by solving the coupled-channel Schrödinger equation. The results of these calculations and the implications for the astrophysical photodissociation of CS and C2 will be discussed.