Electronic structure of red amorphous phosphorus studied by X-ray spectroscopy