Advances in nanophotonics, quantum optics, and low-dimensional materials have enabled precise control of light-matter interactions down to the nanoscale. Combining concepts from each of these fields, there is now an opportunity to create and manipulate photonic matter via strong coupling of molecules to the electromagnetic field. Towards this goal, here we introduce a first principles framework to calculate polaritonic excited-state potential-energy surfaces for strongly coupled light-matter systems. In particular, we demonstrate the applicability of our methodology by calculating the polaritonic excited-state manifold of a Formaldehyde molecule strongly coupled to an optical cavity. This proof-of-concept calculation shows how strong coupling can be exploited to alter photochemical reaction pathways by influencing avoided crossings. Therefore, by introducing an ab initio method to calculate excited-state potential-energy surfaces, our work opens a new avenue for the field of polaritonic chemistry.