Let's see...spend money to spray foam onto flex ducts, or spend money to spray foam onto the roof deck. Hmm...which to do, which to do??

If those were my only two options, in a heartbeat I would foam the roof deck and leave the flex alone.

Why?

The foamed deck will return more benefit than the foamed ducts. Again, why? The foamed deck is a continuous benefit, whereas the foamed ducts only benefit when the HVAC is running. And does nothing to reduce heat gain or loss to the house at large. Foaming the deck reduces heat gain/loss to the house AND the ducts.