Very good question, and some good answers.
I've been a contractor for more than 25 years, and in the beginning felt the same as you did. I also found that the "Brotherhood" was less than willing to give information as to their bidding methods. I learned by trial and error.
I'll give you some personal examples, to expand on the great links provided.
In my business, I personally charge $25 to $40 per hour for my own labor. I add to that any employee labor I have to use and charge for. If you haven't procured one yet, get licensed.
On occasion, when you can find one, a client will be willing to pay time and materials. Certainly that should be kept within reason by you, the contractor.
For painting I usually charge $25 per hour plus materials, plus some consumables. You cannot ethically charge a customer for tools you should already have.
I also do painting and other jobs for non profit agencies. An example of my fee for painting, is 75 cents a square foot, plus any major cut work or masking I might have to do...Prep and cleanup by the way must be accounted for.
In that regard assume I paint 1000 sq. ft. That equates to $750 BASE charge plus materials, plus consumables required, plus deciding the difficulty/time factor.
I am not wealthy, but I have more work usually than I can get to, and it satisfies me.