Well first, I pray about it.
I would also confront them about it and ask them if there's something I can do to help. Maybe they are that way because they are going through a difficult time in their life and they don't know how to handle it. When confronting, I wouldn't be judgmental as maybe they just end up needing someone to talk to.
Now, if they don't want help or they just end up being the type of person who is just negative, I would try to keep my distance as much as possible. Why throw fuel on the fire if they are just a negative person?