If it's an aloe vera, you can reroot it. (Some of the other species are difficult, if not impossible, to get to root.) Cut the stem about 2 inches below the lowest leaves. You will notice a thin, papery skin. That must be removed from the stem, so the new roots can emerge. Allow the cut end to air dry, away from direct sunlight, for about 24 to 48 hours.
Select a clean pot that has good drainage holes, and fill it with a soil mix designed for cacti and succulents. Wet the soil well and allow all the excess water to drain away. Then make a hole, insert the stem of the aloe, and firm the soil around it. Rewater it a bit to settle the soil around the stem.
Depending on the size of the aloe, you might need to provide some support for it until there are sufficient new roots to anchor it in the soil. I usually just use a few smooth rocks, setting them around the base of the plant, so it doesn't fall over.
"Isn't it enough to see that a garden is beautiful without having to believe that there are fairies at the bottom of it too?" - Douglas Adams