Replace the radiator. They're inexpensive. That foam may be some sealant the previous owner put in the radiator so you wouldn't notice the leak.
Also if you continue to drive it make sure the coolant is full otherwise you could destroy the engine. I'd take it to a radiator shop asap.