It's hard to know what to do, but I think the best thing is to give to local charities that help the homeless/poor. I don't understand a certain group -- young people who show up every summer here in our little town. They have chosen to live as beggars, they're young, strong and healthy. They beg all the time and are absolutely filthy. It's a con, the local government has asked us not to give them money as they cause a lot of trouble and giving them money encourages them to stay.
Years and years ago I lived in San Diego. Late one evening I was waiting for the tram so I could go home. No one around but homeless people and me. A very scary-looking guy came up to me and shoved a young woman at me. She was seriously stoned. He said, "she's hungry. Buy her some dinner." So I did, there was a fast-food place open, we went in and I bought her dinner but she was too stoned to eat. I got on my tram and went on home, wondering about this guy who ordered me to buy her dinner.
Lots of bad experiences with pan-handlers in San Diego. I hate to see them gathering up here in our small town. We have a few genuinely homeless, mostly mentally ill, and the locals make an effort to take care of them. This group that calls themselves the Rainbow People is homeless by choice, and when they aren't panhandling they steal and cause other problems.
I did give a guy some money once outside the grocery store. He played and sang a damn good version of St. James Infirmary, worth a couple of bucks.