The soldier pointed a gun at the man.

Literal

Soldier [topic-は] that man [target-に] gun [object-を] aimed.

に marks the target of the action — the person the gun is pointed at. 向ける means to direct or aim something toward a target, distinct from 向かう (to head toward).