Research studies suggest an association between substance use and sexual risk behavior, but are not completely consistent. The moderating effects of other psychosocial factors might help explain these inconsistencies. The current study therefore assessed whether substance use is associated with sexual risk behavior, and whether this relationship is modified by expectancies about the effects of alcohol, reasons for consuming alcohol, or intentions to engage in safe sex. A cross-sectional survey was conducted among 480 black South African men who have sex with men recruited using respondent-driven sampling. In multivariable analyses, the effect of alcohol use on unprotected receptive anal intercourse (URAI) was modified by drinking to enhance social interaction (R2 change = 0.03, p < 0.01). The effect of drug use on URAI was modified by safe sex intentions (R2 change = 0.03, p < 0.001). Alcohol use was positively associated with URAI only among those who drink to enhance social interaction (β = 0.08, p < 0.05). Drug use was positively associated with URAI only among those with high safe sex intentions (β = 0.30, p < 0.001). Our findings suggest that efforts to minimize the impact of substance use on HIV risk behavior should target men who drink to enhance social interaction and men who intend to engage in safer sex. Efforts made to increase safer sex intentions as a way to reduce HIV risk behavior should additionally consider the effects of substance use.