I gave a tube to a guy once. I rode past him and his friend, they were stopped on the side of the road on a rainy day (winter in Vancouver) and I asked if they needed anything. They said they blew about four tubes between the two of them in their ride (winter in Vancouver, bis) and patching was an issue in rainy weather. I happily gave them one of my spare tubes (I ride with 3 spares in the winter) and hoped they would be fine. The guy wanted to pay me for the tube, I asked that he just give one to the next person-in-need instead. He was happy with that. Pay it forward.
I don't like giving CO2 to a person who's blown their tires off already, means they might not be very skilled at using it. Maybe I'd offer to do it myself. But I'd rather take the frame pump (mine is not that bad). If I feel the person knows what they're doing I wouldn't hesitate handing them a cart.