The white areas are the "nuptial chambers created when the beetle eats the Phloem, which is best called "inner bark". That's where sugar and other good things are concentrated. Girdling the phloem keeps carbs from getting down to the roots, so root tips die. Then water intake quits, and the crown fades. Blue stain probably clogs the sapwood, also restricting water movement, and maybe keeping stored water in the heartwood from migrating into the sapwood (that's just my guess). "Sap" is a water solution that moves up in the sapwood. Resin (aka pitch) is a hydrocarbon that is formed in resin ducts within the tissues. It is pitch that "pitches out" beetles and covers wounds, not sap. Sap doesn't drip from cuts, pitch does. However, a well! -hydrated tree has more pressure on its resin canals, giving a better push on the beetles.
(contributed by Ronald Lanner, The Piñon Pine - A Natural and Cultural History)

 
 
 

The bark beetle is also called the "Engraver Beetle" due to the pattern created when they eat the phloem
.