My husban is a smoker and has been coughing up phlegm with black spots. What could this be?

Abnormal sputum. This could be traces of blood or other substances. Your husband needs a thorough medical evaluation to rule out cancer and other serious disease of the lungs.
He should see doctor. Black spots could just be from the tars in the cigarette smoke, but old blood also looks very dark and can seem black. I would strongly urge his seeing his doctor asap and being evaluated. If he came to me, i would be at least getting a chest xray, and if there were other suspicions, perhaps a chest ct scan as well. He needs to stop smoking, and you need to stop too if you are a smoker.