The pessimism, he wants someone to commiserate with, ie share complaints with. You should complain about something with him ie your girlfriend/wife, your mom, friend, commute to work, finding a parking spot, traffic, etc - just about anything. You'll see him listen to you complaint and become more friendly to you.
Give it a shot, sounds like your already in a bad place so you have nothing to lose. Hopefully this helps - good luck.
1. Try talking to him about it. Maybe he'll change (doubtful, but worth a try).
2. If the above doesn't work, report to his/your boss or HR depending on the severity. Keep in mind if he is well-connected or protected in the company, this may backfire. Best case scenario is they force him to change or put him or you on a new team.
3. If the above doesn't work, then it demonstrates your company does not give a damn about you and your only option is to find a new job. As a bonus here, you could explore legal options if harassment from this employee is illegal (race or gender discrimination, etc).