1. He will hit the boy with a pen.

---------------------------------------
Does 'with a pen' modify 'will hit' or 'hit'?
'Hit' is a verb. "Will hit' is a verb phrase.
Does 'with a pen' modify the verb phrase or the verb?

Does 'with a pen' modify 'the boy' or 'boy'?
'The boy' is a noun phrase, and 'boy' is a noun.
Does 'with a pen' modify the noun phrase or the noun?

The whole verb is "will hit" because it's in future tense. Therefore "with a pen" is modifying "will hit."

The prepositional phrase is modifying the main verb. It has nothing to do with the subject.