Phase control of photoabsorption in optically dense media