It's called hemoptysis. It could be caused by an infection like pneumonia or TB; better see a doc ASAP; he'll probably order x-rays and blood tests to diagnose. And sputum and skin tests for TB. If not treated promptly, it could cause permanent lung damage. Cancer could also cause it, but unlikely at your age. Link:
http://www.pulmonologychannel.com/hemoptysis/ Hemoptysis
I had blood in my phlegm and it turned out to be a rare bacterial infection, which ultimately caused damage in my right middle lobe. I also cough alot when i laugh, and that is from the damage left in my middle lobe. I'm alot older than you but even in my 40's i was also afraid it was lung cancer. Go check it out, it could be a number of things, even pneumonia, it is unlikely it is cancer at your age.
lisa