What is blue stain, and why it cuts the value of beetle-killed timber

Anyone who has watched a mill scaler walk a load of beetle-killed pine knows the drill. The bark is off or sloughing, the wood underneath looks sound from six feet away, and then the scaler splits a bolt or checks the end grain and there it is: a gray-blue smear running through the sapwood like a bruise. That's blue stain, and it's the reason a stand that looked like decent salvage on the cruise sheet comes back from the mill at a discounted price.
How the stain actually gets into the wood
Blue stain isn't decay in the structural sense. It's caused by a group of fungi, mostly in the genus Ophiostoma, that bark beetles carry on their bodies and introduce into the sapwood when they bore in to lay eggs. The beetle doesn't cause the stain directly. It's a hitchhiker, and a pretty effective one, since the beetle galleries give the fungus a straight shot into living sapwood tissue that would otherwise resist it.
Once established, the fungus spreads through the ray cells and colors the sapwood blue-gray to almost black, depending on species and moisture. It doesn't rot the wood or reduce its strength in any way that matters for construction lumber. That's the frustrating part for anyone trying to move salvage volume. The defect is almost entirely cosmetic, but cosmetic is exactly what grading rules and appearance-grade buyers care about.
Stain pressure builds with time. A fresh red-attack tree, needles still turning, usually has limited stain because the beetle and fungus haven't had a full season to work through the sapwood. Leave that same tree standing through another summer and it's a different log by the time it hits the landing. The stain has had the moisture and the season it needs to run the length of the stem, sometimes deep enough that a sawyer can't open up a clean face anywhere in the cant.
Why mills knock the price down
Grading rules for most softwood species treat blue stain as a cosmetic defect, and appearance-grade and shop lumber buyers discount for it hard, since the whole value of that grade rests on a clean, uniform face. Pulp and OSB markets care a lot less, since the fiber goes into a furnish where color doesn't show up in the finished product, but pulp pays a fraction of what dimension lumber does, so routing stained volume there is still a downgrade in revenue even when the logs are perfectly sound.
Mills that take beetle-killed wood at all usually run a sapstain discount schedule off the scale ticket, a flat cut per unit volume once stain shows past a threshold on the sample ends. Agencies and private sellers moving salvage sales feel that discount directly in the stumpage return, and it's one of the harder numbers to predict at the time a sale is laid out, because the stand was cruised months before the logs ever reached the scale.
Racing the stain, not just the beetle
The practical problem for anyone scheduling salvage isn't "will this stand get blue stain." Grey-attack wood that's sat a season or two almost always has it. The problem is catching stands early enough in the red-attack window that the harvest crew is cutting ahead of the stain rather than behind it, and doing that across a monitoring area where stands are turning from red to grey on different timelines depending on aspect, elevation, and when the beetle got there.
That's a stage-tracking problem more than a beetle-counting one. Bark Beetle Detection reads the red-attack to grey-attack color progression across a monitoring area monthly from high-res multispectral imagery and scores each stand by infestation stage, so a sale planner has a register of which stands are still early enough to protect lumber value and which have already aged into pulp wood, instead of waiting on the next aerial-survey flight window to find out. If stumpage returns on your salvage sales are getting hit harder than the cruise predicted, it's worth seeing where your stands actually sit on that clock.