This question already has an answer here:
I am running approx 40' of cable thru the unfinished attic in order to install two additional receptacles in the kitchen. The easiest and least obtrusive way for me to do this is to attach 1x3 or 2x4 lumber to face of the rafters to serve as a raceway, then staple the cable every 4 feet or so onto the surface of this raceway. The wood strips will be attached to the rafters approx. 4' up from where the rafter tails meet the floor. At the end of the run, the cable will drop into the kitchen wall.
Does this installation meet current NEC code, or is there something else I need to do to make this meet code? Tks.