I've wondered this, too.
Both must have roles in which they are superior to the other--if this were not the case, then only one would be carried. We can say this with certainty.
Now, to determine how they compare we need to know what they are.
Photon torpedoes are easy to describe--they are a delivery mechanism for a matter/antimatter warhead, which itself consists of dozens, hundreds, thousands, or tens of thousands of discrete packets of matter and antimatter which are synchronized to be slammed into each other at exactly the same moment in time for the highest possible reaction efficiency. We can calculate with some exactitude the yield of a photon torpedo warhead, based on assumptions about the amount of matter and antimatter in the warhead and the efficiency of the reaction. In an orbital bombardment scenario, for example, we can assume nearly 100% reaction efficiency if a photon torpedo is launched into an atmosphere. Almost definitely photon torpedoes are the weapon of choice for indiscriminate planetary bombardment. In a vacuum, significantly less than all the antimatter and matter will be reacted to produce gamma rays--the high-energy photons will tend to blow the remaining reactant out of the area. The smaller the reaction packets, and the better synchronized they are, the greater the efficiency will be, but will never be 100% efficienct--even at in the perhaps unlikely situation that every atom of reactant is kept in its own Penning trap triggered in the same Planck time as the rest, I think quantum effects would still prevent total annihilation. However, even with generosity, we can perhaps assume an efficiency no greater than 50%. Further, the gamma rays produced will, in the absence of some sort of reflective surface to concentrate them, bloom on average omnidirectionally. Thus, whatever the efficiency of the reaction, still only about 50% of the energy converted from mass is going to be received by the target, even detonated right next to it. Of course, detonated kilometers out, even less is going to hit the target mass--the starship.
The great thing about photon torpedoes is that under these constraints, their exact yields can be calculated, and compared to real life WMDs.
Phasers (and disruptors, which are no doubt basically identical), by contrast, are inconsistently described, even more inconsistently shown in the VFX, and are hard to understand. They may be energy or they may be mass. There may be some sort of subspace effects going on. They involve something called a "nadion" which, as far as our science knows, does not exist.
Personally, I like to think of them as a simple neutral particle beam, comprised of "nadions" if you demand it, generated by accelerating arbitrarily large amounts of charged "nadions" to significant fraction of c, then spit through an electron or positron cloud to neutralize the beam. The nadions have to be charged in order to accelerate them; they have to be neutralized later in order to overcome the effects of electrostatic bloom. (Unlike what Balance of Terror would have us believe, a plasma weapon is a terrible idea.) A neutral particle beam will still repel itself by thermal bloom, but this is less severe. At any rate, the yield of a neutral particle beam can, like a matter-antimatter warhead, be calculated pretty well. The yield is ultimately the aggregate kinetic energy of every "nadion" that finds its way to the target. Unlike a pho-torp, this yield will drop off with distance, due to the aforementioned blooming effects.
I should point out that only at very high fractions of c would (what began as) two kilograms of phaser "nadions" remotely approach the destructive force of two kilograms of antiparticles slammed together, and who knows how much antimatter would have to be spent and how many inefficiencies endured in pumping the "nadions" up to a high relativistic mass. Pho-torps are almost definitely cheaper per striking power per particle in terms of antimatter fuel.
If deflector shields work like I think they do--by expanding and contracting space through a nonpropulsive warp field--then phasers should be more useful in striking the target mass inside. A photon torpedo is a very sensitive mechanism, and different rates of acceleration applied to the device by a changing warp field would produce stress on its insides, leading to a breach in containment around one of the antimatter packets, and one broken packet would almost certainly cook off all the rest, and probably at a greatly diminished efficiency from its normal operation. Gamma rays would still strike the target, but at less than killing intensity. Phasers are far more robust in comparison--a warp field would have relatively little effect on the kinetic energy contained in the "nadions," which would move through the deflectors toward the target, although possibly through expanded space which would diffuse the stream through thermal bloom.
So, if this is all correct, photon torpedoes are better at blowing things up, and phasers are better at hitting an object behind shields. This gives them each a vital role to play as part of a starship's armament. The pho-torp is definitely "more powerful," and longer ranged, but the phaser, if it has the shield-penetrating properties I ascribe to it, is actually the more indispensible weapon.