It may be because of overstraining or using too much effort to cough out the mucus.You are most likely having infection due to seasonal changes.
Next Steps
Are you having fever or excessive dry cough or any other symptoms?
Health Tips
If blood comes again you should consult online or nearby pulmonologist. Don't worry , Relaxand try to breath normally.You will require some antibiotics and mucolytics.