When switching times are no longer dominated by the plasma formation time, such as for photoconductive switching of high-voltage spark gaps, electrodynamic details of the switching process determine the rise time and pulse shape of the switched pulse. We show that the commonly used zero-dimensional lumped element and one-dimensional transmission line theory are no longer sufficient for optimizing such fast-switching devices, because important electromagnetic-field propagation in three dimensions is neglected. In order to improve the output of the photoconductively switched spark gap, we developed an optimization procedure for spark gap geometries based on full three-dimensional electrodynamic simulations. By monitoring the electromagnetic-field propagation in time, it will be shown that the initial electromagnetic-field disturbance in the gap reflects at the outer conductor and interferes with the initial field. The reflection and interference are essential for the shape of the output signal. We propose the following optimization procedure to improve the output of the photoconductively switched coaxial spark gap. Initially, the reflection and interference can be influenced by reshaping the inner conductor. The outer conductor can be used to fine-tune the system to get an output pulse with a sharp rising edge and no significant oscillations. We also present the optimal spark gap geometry that gives the best output signal at photoconductive switching.