Questions!!!!

Why am I having brown discharge?? I'm towards the end of my period but it's really ugly and gross color