When you speak, air passes through the voice box in your throat and hits two bands called vocal cords. Your voice make sounds when they vibrate.
A cold can throw a wrench into this smooth-running machine. Your throat gets inflamed and sore. Then, your vocal cords swell, which affects the way they vibrate. The end result: You're hoarse.
To treat this, rest your voice and drink plenty of fluids. Your volume will return when you recover.