Information in this thread indicates that Dittos behave against raid bosses just as they would against regular gym defenders. That is, the Ditto will pick up the Attack and Defense IVs of the raid boss and convert its CP accordingly. However, it will not increase its HP stat or its level, so it will likely just be a sort of glass cannon, depending on what it transformed into. The reason that raid boss Pokémon have such high CP is due to them being buffed to a level impossible to actually attain as a player, which a Ditto wouldn't copy.
Just saw my first raid and went for it even though it was an easy difficulty level. Croconaw, CP5207. Ditto transformed into him and didn't even faint as myself and another trainer's Jolteon defeated it in 27 seconds. My Ditto was CP1270 after using transform, but was surprisingly able to weather two Crunches and a few Scratches. (A 96%, L28.0 Croconaw is CP1270, by the way—same level and IVs as my Ditto, Blob Loblaw. I still feel like there's something else at play, since he was able to survive two Charge moves.)
In other words, Ditto isn't completely useless in raid battles, since it will likely have a high defense against the raid boss (turning into a Venusaur whose Solar Beam is now 4x ineffective against a transformed Ditto, etc, but exact opposite situation if transforming into Dragonite (weak against its own typing)), but since a transformed Ditto retains its HP, it likely won't last too long in battle.