How to synchronize readings with the HIGH and LOW states of a PWM output?
Generally you'd probably want to use the PWM peripheral on the MCU chip and generate an interrupt from the PWM peripheral, then make the ADC measurement (or at least trigger it to begin) in the interrupt service routine. The details, such as which PWM mode to use, and how well it will work depends a lot on the chip. Worst case, you could wire the PWM output back to an interrupt input. You may also need a delay to allow the ADC input to settle after the LED state changes, so perhaps another timer would be involved depending on exactly when in the PWM cycle the interrupt is generated (check out phase-correct PWM if you're using an ATmega328). 

Your use of the term digitalWrite implies you're trying to do this with some Arduino or Arduino-like module, so you'll have to study the underlying chip (eg. Atmega328) features and how to use interrupts. 

You may be able to get more specific help in the Arduino forum.