Laser action in ionized sulfur and phosphorus