I recommend the 2x4 with 4 side up.
Here is what I did, I bought the ends to steps, in other words, they are the end wood portion of a stair case. They are the part you screw the actual step to. I bought two then nailed one to each side of the coop and then nailed down my 2x4 for the roost (ladder style). It worked great. I bought them at Lowes, I am sure you can make your own so if you get by Lowes are Home Depot go to the lumber section and you will see what I am talking about. They were not terrible expensive (although this was about 5 years ago).
I have mixed flock of bantams and heavy breeds so I started my roost at 30 inches above the floor and went up. I have a total of 5, 2x4's.
I also recommend a dropping board under the roosts (elevated) to catch the poo. I also bought a linoleum remnant to lay over the board. Each week I take a dust pan with brush and sweep up the poo, place in a five gallon bucket and then throw on my flower beds and garden. Then once a month I remove the linoleum spray with a bleach solution and hose off. This set up works great and it also saves the litter from getting really dirty, therefore, I only have to change the litter maybe two or three times a year. So my point is the roost system I built cost a little extra in the beginning but I have more than saved the cost over the years as I don't have to clean out the coop nearly as often thus saving money on bedding.