Medicines and chemicals are stored in dark colored bottles to prevent their:
photochemical decomposition
Some chemicals and medicines decompose in the presence of sunlight. So in order to protect it, they are stored in dark colored bottles. They can undergo photochemical decomposition which can change the chemical composition entirely and hence making it unfit for any use.