This is a fairly simple calc but you have to know the following things:
Load on the beam and the way in which it acts (assuming this is a beam on the top of a door frame supporting the wall/roof above, the load will be an assumed uniformly distributed load across the length of the beam).
The cross section dimensions of the beam
The material properties of the beam - tensile modulus mainly
Then you assume its clamped at each end with the distributed load running between the clamps. Calculate your second moment of area based on the equation (bd^3)/12 (thats assuming its an I-beam) and calculate your moment using an equation based on the above assumptions. Can't remember that one and my data book is at work
Then you use the equation: Stress = My/I, where M=moment, I=second moment of area and y=distance from the neutral axis.
You want to know the stress on the outer fibre of the beam as this is where it is greatest...so y=distance from the centre-line to the outside (assuming cross section is symmetrical).
A beam like this will always fail in tension so once you have found your stress on the lower edge (i.e. the edge in tension) you compare that to the tensile modulus of the material. If your calculated stress is greater then boom your house falls down. I'm not a civil engineer but I assume they will throw a safety factor in there too in order to pass inevitable regs.
The tricky bit is estimating the load and this would need to be done by an experienced architect or civil engineer. As has been said, I'm sure you have to get someone qualified to do this calc for you.