There are two types. The temporary homeless who have fallen on hard times and the chronically homeless who have chosen to be either through dependencies or mental illness. The best you can do for the second is provide some charitable donation through an agency that can be trusted and also can give them the medical and psychological assistance they need.
I assume you are talking about the first though.
Two points. Not everyone has somewhere they can go to. Yes, there are people who will leave their family and "friends" on the streets. That is why there are shelters. Secondly, just because you an get a job does not mean that it pays enough to get you off the street. It is not uncommon for someone (and their family) to be homeless for a year or so while they save enough money to get off the streets. In fact I believe the average time for homelessness is 1-2 years for that reason. The question is do you care enough to help provide (through agencies) for their basic needs of food, clothes, and shelter while they are doing that. That is why it's called charity.
Why do I keep saying agencies? Because there are pretenders out there who choose begging as a career. I do not believe you should ever give money to people on the streets. If they say they need food, give them food, see what they do with it. Money though should go through an agency that you can trust to provide for their needs.