Employee states was trying to line up a bar for the rail change. A co-worker was swinging a sledgehammer and missed the bar, hitting this employee in the nose. This was a tight area working next to grapple head, which was providing down pressure on rail.