Like kevin said the attic heat restores this to a liquid form and it flows out.
Attic wood leaking sap.
Treat the knot areas with extra coats of the finishing material.
The reason it is leaking out of the wood there is because it looks like there was a particularliy resinous knot in the pine.
To prevent sap from leaking out of deck boards it needs to be finished with paint stain or deck waterproofing.
Turpentine works perfect for this purpose and it will not damage the quality of the wood.
When it dries it hardens and becomes difficult to remove creating unsightly spots or bumps in the wood surface.
The sap when in live trees carries nutrients throughout the tree that helps to keep it alive.
Use a coarse plastic sponge to scrape the oozed resinous compounds and go over the surface of the wood with a clean towel.
These materials slow the leakage by clogging the wood grain pores but will not stop it completely.
For a start you need to clean all the sap which is gradually crystallizing on the top of the affected wood.
Attic ambering refers to wooden beams in the attic having sap leak out.
Amber is fossilized resin.
You can try removing sap with several different cleaning techniques but there is a chance it will come back.
Much of the wood produced for framing lumber has pitch pockets or areas of crystalized resin.
When it is wet it is sticky and can rub off on clothing or attract dust and dirt.
Similarly when a tree is damaged the sap can bleed out.
Sap can caused a problem on decks and in houses where wood beams are used for support.
It probably got hot enough in the attic and it melted out this happens over time through many heating and cooling cycles.
Hopefully not on your hands as you steady your walk through the attic.
While there are complex chemical components found in tree sap it s easy to compare sap to blood.
Just use a razor bladed scraper remove off the timber and let it be.