Loft beds generally have a railing to remind the occupant that rolling out is a bad idea. Here, we decided to use plywood cut into cloud shapes (who doesn't want to sleep on a cloud?). We mocked it up first in cardboard, then cut the shape with a jigsaw, sanded smooth, rounded the edges with a router, painted it, and screwed it to the frame.
The other bed has a piece of 2x4 that joined up to the other bookcase. Utilitarian, but easy and with a nice miter and rounded edges (I used a roundover bit in my router), it looks good.