You may not run white cable in a living space. If you need to run it along the beam then carefully chisel out the edge of the drywall and insert the wire under the drywall and beam. Then cover it with a molding or drywall to hid the wire. Be careful not to nail the wire if you use molding. Where the wire comes out to the fan put a box to hold the fan and the wiring properly.