The secret is to 'blot' the marks. Don't scrub them or else you will just spread them around and you'll be left with a dingy headliner. Spray some foaming upholstery cleaner on it (Prestone or Tuff Stuff are my favorites off the shelf) and then let it soak for a minute. Spray some more and then press a clean towel against it. Avoid 'scrubbing'. Use a vacuum to suck out the foam and you should be good.
Alternatively you could use super hot water and get similar results, but it is tricky to use on something like the headliner without burning yourself. The foaming upholstery cleaner is the best route to take.