Experience of stressful life events is associated with risk of depression. Yet many exposed individuals do not become depressed. A controversial hypothesis is that genetic factors influence vulnerability to depression following stress. This hypothesis is most commonly tested with a 'diathesis-stress' model, in which genes confer excess vulnerability. We tested an alternative model, in which genetics may buffer against the depressogenic effects of life stress. We measured the hypothesized genetic buffer using a polygenic score derived from a genome-wide association study of subjective wellbeing. We tested if older married adults who had higher polygenic scores were less subject to depressive symptoms following the death of their spouse as compared to peers who had also lost their spouse and who had lower polygenic scores. We analyzed data from N=9,453 non-Hispanic white adults in the Health and Retirement Study (HRS), a population-representative longitudinal study of older adults in the United States. HRS adults with higher wellbeing polygenic scores experienced fewer depressive symptoms during follow-up. Those who lost their spouses (n=1,829) during follow-up experienced a sharp increase in depressive symptoms following the death and returned toward baseline over the following two years. Having a higher polygenic score buffered against developing depressive symptoms following a spouse's death. Effects were small and clinical relevance is uncertain, although polygenic score analyses may provide clues to behavioral pathways that can serve as therapeutic targets. Future studies of gene-environment interplay in depression may benefit from focus on genetics discovered for putative protective factors.