If a small child or a baby gets a sunburn, seek the help of a doctor immediately. A doctor can check the small child for signs of heat stroke, burn damage, blistering of the skin, or very painful redness. Since small children have the most sensitive skin, their sunburn can be far more serious than that of an older child or an adult. Keep small children in the shade at all times, and if they get a sunburn, take them to a doctor to make sure they are OK.
If blisters or a rash appear on a sunburn and it becomes very painful (so painful that you cannot move the sunburned area or it is very distracting) a doctor may be needed for assistance. While you can help soothe a sunburn with calamine lotion yourself (or Aloe Vera), if your sunburn becomes extremely painful to the touch or the pain does not go away with self-treatment, a doctor may be your best bet overall.
If your sunburn will not cool down after applying cool water to the area (don't do ice- ice can damage skin and nerves) for a half hour to an hour, then you may have heat damage or heat stroke. Also, if you have a temperature or fever in addition to a sunburn, a doctor's intervention is helpful. You could be suffering from more than just a sunburn, and you want to make sure you don't injure yourself further by ignoring other symptoms of sunburn danger.
Seeing a doctor even for a mild sunburn can help you out significantly, since a doctor can prescribe treatment and prevention aid for your sunburn to begin with and help you keep from getting a sunburn in the future. There are sunburn aftercare treatments available, and also home treatment recommendations (like calamine lotion and aloe Vera) that your doctor can prescribe to you.