A stochastic epidemic model is formulated for the study of the protective effects of vaccination in a population that is stratified by vaccine-related factors. The epidemic model is transformed into a counting process, and then martingale-based methods are used to provide estimators of vaccine efficacy and their variances. Following an example, various extensions of the model are discussed.