In this work we study the effect of behavioral changes of individuals on the propagation of epidemic diseases. Specifically, we consider a susceptible-infected-susceptible model over a network of contacts that evolves in a time scale that is comparable to the individual disease dynamics. The phenomenon is modeled in the context of activity-driven networks, in which contacts occur on the basis of activity potentials. To offer insight into behavioral strategies targeting both susceptible and infected individuals, we consider two separate behaviors that may emerge in respiratory syndromes and sexually transmitted infections. The first is related to a reduction in the activity of infected individuals due to quarantine or illness. The second is instead associated with a selfish self-protective behavior of susceptible individuals, who tend to reduce contact with the rest of the population on the basis of a risk perception. Numerical and theoretical results suggest that behavioral changes could have a beneficial effect on the disease spreading, by increasing the epidemic threshold and decreasing the steady-state fraction of infected individuals.