We present a new method for the detection and measurement of a periodic signal in a data set when we have no prior knowledge of the existence of such a signal or of its characteristics. It is applicable to data consisting of the locations or times of discrete events. We use Bayes's theorem to address both the signal detection problem and the estimation problem of measuring the characteristics of a detected signal. To address the detection problem, we use Bayes's theorem to compare a constant rate model for the signal to models with periodic structure. The periodic models describe the signal plus background rate as a stepwise distribution in m bins per period, for various values of m. The Bayesian posterior probability for a periodic model contains a term which quantifies Ockham's razor, penalizing successively more complicated periodic models for their greater complexity even though they are assigned equal prior probabilities. The calculation thus balances model simplicity with goodness of fit, allowing us to determine both whether there is evidence for a periodic signal, and the optimum number of bins for describing the structure in the data. Unlike the results of traditional "frequentist" calculations, the outcome of the Bayesian calculation does not depend on the number of periods examined, but only on the range examined. Once a signal is detected, we again use Bayes's theorem to estimate various parameters of the signal, such as its frequency or the shape of the light curve. The probability density for the frequency is inversely proportional to the multiplicity of the binned events, which is simply related both to the combinatorial entropy of the binned distribution and to the chi2 measure of its misfit to a uniform distribution used in the "epoch folding" method for period detection. The probability density for the light-curve shape produces light-curve estimates that are superpositions of stepwise distributions with various phases and number of bins, and which are thus smoother than a simple histogram. Error bars for the light-curve shape are also easily calculated. The method also handles gaps in the data due to intermittent observing or dead time. We apply the method to simulated data generated with both stepwise and sinusoidal light curves and demonstrate that it can sensitively detect such signals and accurately estimate both the signal frequency and its shape, even when the light curve does not have a stepwise shape. We also describe a test for nonperiodic source variability that is a simple modification of our period detection procedure.