Without being there, I'd say it's spray foam that has been coated with something. And since there's a good chance that coating is incompatible with foam, tearing it off down to the decking and installing a new flat roof system is the way to go. Time to get some bids.