You can buy foam safe paints ay the craft stores, I bought some from Michaels and Hobby Lobby(the craft store) from a can and up. Styrofoam safe matt varnish spray paint.
Faux concrete paint treatment (with a secret ingredient!) used on dollar tree pumpkins and styrofoam head forms! Get the tutorial at HOMEWARDfound Decor.
What is a little more difficult for many is painting Styrofoam or Builder's Foam, as any other materials such as paint thinner, will be safe to use on the object.