If you are vomiting
as opposed to coughing it is more likely the bleeding is coming from your gastrointestinal tract. That being sad a lung cancer
could erode into the GI tract and cause the vomiting of blood. If you retch to hard from vomiting, you could have a tear of your esophagus that could bleed. If you do vomit blood, you should see a doctor.