I have 2x8's on end spanning 12 feet. They've held up to some pretty good winds, probably similar to what you'll see in your afternoon thunderstorms but not what you will see in a hurricane.
Will a 2x4 handle a 12 foot span? Not no how, not no way. Will they handle a 6 foot span? Probably, I'd even say yes. But I'd attach them real well to the end and middle supports so you don't get them flexing upward. Use good screws or nails long enough and nails with the ribbing so they don't work loose. Some type of connector or strap to hold them down might not be a bad idea.
I know from experience that a roof will lift off in a high wind. The people I bought from used short smooth nails. Those did not work.