When I did similar I used expanding foam, but I wasn't keeping the beams exposed so it didn't matter if I got it on them. And your right it made a mess.
The other option is normal insulation packed in there... But this will make a mess of your arms.
How big are the gaps?