First, try not to get burnt. Use at least spf 50. A good rule of thumb: if your shadow is longer than you the sun will not burn you. In Buenos Aires between 9am and 6pm the sun will burn you (in other places you have a smaller window, but here it really is all day in the summer). It only takes 15 minutes to get burned.
If you do get burned, apply aloe and Lidocaine as Rodolfo said, but apply a lot and often. I am very fair and have made burns go away in a day by applying aloe every 15 minutes, as soon as it is absorbed apply more. If it is just aloe you can´t apply too much. When I do this the pain stops in 12 hours and there is no peeling. Use lidocaine (which takes away pain) more spairingly.