This is the $64,000 question. What to do? Stricter laws and background checks for gun buyers. Yes. However the underlying problem isn't addressed which is that these people are mentally imbalanced. How to screen them so they can't buy guns and then how to help them. That is the ultimate solution.
Also, a statistic: 60% of adult deaths by guns in the U.S. is from suicide. That to me is very morbid. People need to change; grow; evolve; and be happy with oneself.