On page 62 of the Next Generation technical Manual, the use to which warp core output is put is described. The final paragraph on this page states : 'Taps for the electro plasma system (EPS) are located at three places along the PTC, at 5, 10, and 20 metres aft of the shear-plane joints. Taps for the EPS are available in three primary types, depending on their application. Type 1 accepts 0.1 capacity flow for high-energy systems. Type II accepts 0.01 input for experimental devices. Type III accepts relatively low power input for energy conversion applications.'
Presumably systems such as the phasers and shields would fall into the category of 'high energy systems', and therefore would take up 10% of overall warp core output. Based on the 1 x 106 TeraWatts figures calculated for total power output, this would give the phaser banks a power rating on the order of 1 x 105 TeraWatts.
In battle Federation Starships rarely fire more than one array at a time. This indicates that the entire output can be channelled through a single array if required.
In this episode the Enterprise-D must use a phaser array to tunnel its way through 1,600 metres of rock in order to allow the transporter to beam an away team to an underground facility. The drilling operation requires several hours of preparatory work on the phasers, but this is not stated to be done in order to allow them to fire at higher power than normal.
The phaser beam strikes the surface of the Turkana IV colony world. 
When the beam strikes the surface, a shaft is sunk into the surface. This shaft has a diameter eighteen times that of the phaser beam which is making it. From the scale diagrams in the Technical Manual, the phaser strips of a Type X array as installed in a Galaxy class Starship are approximately six metres in width. The beam is emitted by the whole width of the strip; assuming a beam of constant cross section, this indicates that the shaft is some 70 metres in diameter. Hence a total of 6,158,320 cubic metres is vaporized. The drilling operation takes thirteen seconds to complete.
Assuming a density for the rock of 2,300 kg/cubic metre, a boiling point of 2500 K, and a specific heat of 720 J/Kg/K, we can calculate the energy required to vaporize this volume of rock :
|E ||=||6,158,320 x 2300 x 720 x (2500-293)|
| ||=||2.251x1016 Joules|
The power rating would therefore be 1.731 x 103 TeraWatts.
Since the majority of the evidence indicates that the Type X can put out 100,000 TW, this indicates that the phasers where used on a setting of 1.73% during the drilling operation. This is a pretty reasonable assumption; we see the Enterprise fire into a Borg cube at near-maximum power in 'Q Who?' (see below) and it blasts a crater at least as wide as it is deep. Since the aim in 'Legacy' was to drill a deep, narrow shaft rather than blast a large area, a long and low powered burst would be exactly what was required. This is most especially true as the Enterprise was firing directly down onto a city containing a large civilian population.
During this episode the Enterprise-D confronts a Borg cube which initiates an attack with a tractor beam and cutting beam. The cube is unshielded. Captain Picard orders Lieutenant Worf to 'bring whatever force necessary to terminate that beam'. The Enterprise fires several shots at the cube, damaging it and terminating the tractor beam. Of the visible damage to the surface, one shot into a face of the cube has vaporized a roughly hemispherical volume who's diameter is close to that of the Enterprise Enterprise, i.e. about 600 metres.
This image clearly shows that much of the phaser blast actually passed through the Borg cube rather than being expended upon it.  A good view of some of the damage inflicted on the Borg cube by the Enterprise. 
We don't really know the composition of the Borg ship. For our first pass at the energy required accomplish this feat, I'll assume it is a solid cube of tritanium. From the tech manual, page 134, we know that vaporizing a 3 cubic metre block of tritanium takes 7.2 x 1012
Joules (see the 'materials' link on the left for further details). The volume of a 300 metre radius hemisphere would be greater than the 3 cubic metre block by a factor of :
|F ||=||(0.5 x 4/3 x pi x r3) / (3 x 2)|
| ||=||56,556,000 / 6|
| ||=||9,426,000 times larger.|
The energy required is thus :
|E ||=||9,426,000 x 7.2 x 1012|
| ||=||6.8 x 1019 Joules|
Now of course, the Borg cube is not a solid block of Tritanium - in fact, from both the exterior views and what we have seen of the interior, much of a Borg cube is unoccupied. Say 50% of the cube is unused empty volume, and say that of the remaining 50%, only about 0.2% is actual walls and floor - the rest being corridors, crawlspaces and the like. Overall, the cube would be about 0.1% solid metal. So a more realistic value for the energy required to do the damage we see is around 6.8 x 1016
The phaser blast lasted around 1 second, so this equates to a total power output of :
|P ||=||6.8 x 1016 Watts, or :|
| ||=||68,000 TeraWatts|
While not quite up to the 100,000 TW figure we get from the Tech Manual, it is well within an order of magnitude. The discrepancy is easily small enough to assume that Worf simply fired the phasers at a 68% power setting; his orders where specifically to bring 'necessary' force to terminate the beam, rather than to inflict maximum damage or destroy the cube.
Who Watches The Watchers?
At the opening of this episode the Enterprise-D is rushing a spare fusion reactor to a scientific station which has suffered a breakdown. Picard, Geordi and Riker are discussing the situation. Geordi reports that they have replicated all the parts they will need, but then says he doesn't understand why a three-man outpost would need a 4.2 GigaWatt reactor. The following dialogue ensues (quoted word for word) :
Riker 'Enough to power a small phaser bank, or a subspace relay station, or...'
Geordi : 'A hologram generator. Oh, a duck blind!'
So, from this we know that 4.2 GigaWatts is sufficient to power a SMALL phaser bank. This directly contradicts the page 123 reference that the Type X, 'the largest emitters available for starship use', have an output of only 1.02 GigaWatts.
According to page 123 of the technical manual, the large phaser arrays of the Galaxy class starship consist of two hundred emitter segments which are 'each capable of directing 5.1 Megawatts'. This would allow the whole array to 'direct' a total of 1,020 Megawatts - a power nearly one hundred million times less than the figure given on page 62! This directly contradicts the 'Who Watches the Watchers' reference which puts a single small phaser bank at 4.2 GigaWatts.
For this and other reasons, this simply cannot be what it seems. A simple calculation will show why. The photon torpedo page concludes that the warhead of these weapons releases energy approaching a maximum of 2.7 x 1017 Joules. Now of course this is a maximum, in that it assumes 100% efficiency of the warhead.
So let's cut it down some : Say only 10% of the atoms of matter and antimatter in the warhead ever actually get to collide, and say that only 10% of the mass of those that do collide is converted to energy. Up to one half of this should hit the shields, but let's say that the warhead is a kind of reverse shape charge which directs most energy away from the shields; we'll say that only 10% of this energy released actually hits the shielding.
Okay, then we get a total energy into the shields of 2.7 x 1014 Joules. So, at 1.02 GW how long a phaser blast does it take to equal a single photon warhead?
|2.7 x 1014 / 1.02 x 109 ||=||2.65 x 105 seconds.|
That's three days
of continual, maximum power phaser firing to equal even a massively weak estimate of the energy of a photon warhead. Use more realistic figures - 99% of all matter interacting, 50% of mass turned to energy, and 40% of radiated energy incident on the shields - and a phaser would need to fire for 1.66 years
to equal a single warhead!
Now of course, photon torpedoes may be vastly weaker than they appear to be - maybe only one atom in a million interacts with an antimatter counterpart. Then again, phaser energy may impact shields - and solid matter also - in some peculiar technobabble process that makes it have the effect of many Terawatts with only 1 Gigawatt of power. Trek does love a good bit of technobabble when things get tricky, after all! Then again, the TNG TM's figure for phaser output may be in error.
Overall, I think it unlikely that photons can be so weak. Even at sixty megatons or so they're within spitting distance of the largest thermonuclear weapons Humanity has ever built - we're talking about taking them down to well below one kiloton in yield, less than a tenth the yield of the Hiroshima bomb. If matter/antimatter weapons were that ineffective there would simply be no point in using them - just use nukes instead.
The technobabble road is an interesting one - there is the mysterious Nuclear Disruption Force mentioned in the TNG TM. It seems unlikely that phasers actually do disrupt all the atomic nuclei in their targets - it takes an amount of energy so high that you don't even want to think about it. The TM hints that the NDF energy sends the the target off into another continuum while it's being vaporized, but we know little more than that. It does seem rather odd that 'nuclear disruption' could affect shields that are composed of some form of energy, rather than an actual material with atoms that have nuclei in them.
Not being a huge fan of technobabble, I tend to go for the last option on the basis that the simplest explanation tends to be the truth (odd word to use in this context!). While technobabble can get you out of pretty much any problem if you twist it enough, it does put you on pretty shaky ground in that it's all basically made up as you go along. And it has little impact on the fact that whatever the ship may put out, those on the other end get the equivalent of much more than 1.02 Gigawatts.
If you want a Trek explanation for the discrepancy, the best I can think of is that 'directing 5.1 Megawatts' is somehow different from 'firing 5.1 Megawatts'. That's pretty lame, I know, but it's the best I can think of without spewing some meaningless technobabble at you.
Much of the data concerning phaser power is reasonably consistent; by far the biggest flies in the ointment are the TNG's 1.02 GW figure for the maximum output of the Type 10 phaser It seems to me that the bulk of the evidence is certainly against these sort of extremely low or high values; certainly the former looks ridiculous when compared to the conclusions drawn concerning the power output of the TOS Type 2 phaser.