To speak to someone; to say words to someone — can mean greeting, encouraging, warning, comforting, etc.
困っている人を見かけたら、まず一言言葉をかけてください。
If you see someone in trouble, please at least say a word to them.
葬式では、遺族に優しい言葉をかけることが大切だ。
At a funeral, it's important to say kind words to the bereaved family.
先生が授業の後で生徒に個別に言葉をかけていた。
After class, the teacher spoke to students individually.