Men who have sex with men (MSM) show high rates of HIV infection, and higher rates of depression than non-MSM. We examined the association between depression and sexual risk among "high risk" MSM. Evidence has been mixed regarding the link between depression and risky sex, although researchers have rarely considered the role of psychosocial vulnerabilities such as self-efficacy for sexual safety or "escape" coping styles. In a national sample (N = 1,540) of HIV-positive and HIV-negative MSM who reported unprotected sex and drug use with sex partners, we found evidence that depression is related to HIV transmission risk. Self-efficacy for sexual safety and cognitive escape mediated the link between depression and risk behavior, suggesting that psychosocial vulnerability plays an important role in the association of depression with sexual risk. These findings may help us construct more accurate theories regarding depression and sexual behavior, and may inform the design of sexual safety interventions.