Yes, medications are exempt from the 3-1-1 rule governing liquids and gels in carry-on bags. If the bottle is larger than 3 oz. you should not put it in the quart bag with your small liquids/gels, but should make the TSA screeners aware of the fact that you are carrying the medication. As you noted, packing medications in checked baggage is not a good idea.