We examine the response of a finite-temperature two-state system to periodic driving using time-dependent transition rate theory. This system can exhibit the phenomenon of stochastic resonance, where raising the temperature increases the signal-to-noise ratio of the response. We obtain the power spectrum and the distribution of residence times nonperturbatively for any transition rates that are periodic in time. Given the drive period T(s), the power spectrum is the Fourier transform of the sum of ''signal,'' which is periodic in time with period T(s), and ''noise,'' which is the product of an exponential and a function periodic with period T(s). The residence-time distribution is the product of an exponential and a function that is periodic with period T(s). Both the power spectrum and the residence-time distribution can be calculated exactly given the dependence of the transition rates on the control parameter (e.g., asymmetry or temperature). We calculate the characteristics of stochastic resonance for a two-state system with activated transition rates and for a quantum-mechanical dissipative two-level system.