The first thing to remember is to be gentle with your scalp when brushing and washing. Use a soft bristle brush when styling (or style with your fingers) and use only fingertips when gently shampooing your hair. This will help keep you from scratching your scalp which could slow the healing process. For after sun exposure, I really like Redken Uv Rescue After Sun Shampoo to help add moisture while removing chlorine and minerals from the hair.
It's also important to avoid styling products which contain alcohol as these will dry the scalp. To replenish moisture, a good moisturizing conditioner and an aloe vera spray (such as Banana Boat Aloe After Sun Spray Gel) will help soothe and moisturize. I like the spray because you can apply it after you've styled your hair -- it can also serve as your styling product for a few days until the burn has passed. To treat the pain a few ibuprofen should do the trick (check with your doctor before taking any medications).
Eventually, your sunburned scalp may start to peel. During this stage, don't scrub or pick at your scalp as this can lead to damage and infection. Just wait it out. Your scalp may look unsightly for a few days, so it may be a good idea to wear a hat to cover it up.
Enjoy your time in the sun. Just be sure to protect your scalp from the sun.