Don't try to solve their problem. Listen and express concern in your voice and body language. Don't be afraid to ask. It's a myth that talking about suicide may give someone the idea of killing him or herself. You are showing you care and take them seriously.
Suicidal individuals are afraid to get help for fear of adding to their pain.
Giving and getting help sooner rather than later is best. Urge professional help. Help the individual contact a local crisis hotline or 911, or offer to help the individual get to a hospital emergency room for professional assistance.