Casting a new light on radiative transfer in solar flare models: synthesis and inversion