Well, the good thing about Buddhism is that hell is also temporary. You don't have to burn in hell forever and ever. There are different kinds of hell realms. There are the fiery hell realms which are hot, and the icy hell realms which are quite cold, so there are different levels of heat, different levels of cold, there are all kinds of different kinds of tortures that happen, depending upon the actions that one produces in a lifetime, depending upon one's intentions, depending upon one's thoughts and speech. So, there are certain unwholesome activities, including having wrong view, that could lead to a lower realm. It could lead to a hell realm, to an animal realm, or the hungry ghost realm. Anything lower than the human realm is essentially a part of expending kamma, any realm lower than the human realm is a process of expending kamma.
Over there you don't have the opportunity - except for the animal realm where there are certain opportunities to create kamma - but especially at the hungry ghost realms and in the hell realms, it's a matter of expending the negative kamma that one has built up. For example, you have the condition of Devadatta*. If i'm not mistaken he's right now spending time in hell, but at a certain point in time he will become a solitary Buddha, because he also had good, wholesome kamma and took refuge in the Buddha, the Dhamma and the Sangha. So, that's the thing; you expend all the negative kamma in hell and once that's expended, you come back according to your good deeds. Most probably either in animal realm or in the human realm, it could even be a deva realm, but primarily probably in an animal or a human realm.
* He was a cousin of the Buddha who tried to kill him and created a schism in the sangha.