Epidemic control often requires optimal distribution of available vaccines and prophylactic tools, to protect from infection those susceptible. Well-established theory recommends prioritizing those at the highest risk of exposure. But the risk is hard to estimate, especially for diseases involving stigma and marginalization. We address this conundrum by proving that one should target those at high risk only if the infection-averting efficacy of prevention is above a critical value, which we derive analytically. We apply this to the distribution of pre-exposure prophylaxis (PrEP) of the Human Immunodeficiency Virus (HIV) among men-having-sex-with-men (MSM), a population particularly vulnerable to HIV. PrEP is effective in averting infections, but its global scale-up has been slow, showing the need to revisit distribution strategies, currently risk-based. Using data from MSM communities in 58 countries, we find that non-selective PrEP distribution often outperforms risk-based, showing that a logistically simpler strategy is also more effective. Our theory may help design more feasible and successful prevention.