For my first aid kit, all of the medications are repackaged. I use nalgene snaptop vials like these.
I have found that even permanent sharpie marker rubs off fairly quickly when hiking. I can usually recognized the difference between medicine, but I may not be the one pulling out the kit.
What system can I use to label containers so that it will not rub off?