There are not general rules. There are various patterns, but you cannot generally predict which verbs fit into which patterns.
Say is a transitive verb where the object (the utterance) is normally obligatory:
I said it.
You must say the words.
(Because what is said can be quoted words, the direct object can precede, in a way that is not normal for other verbs:
He said "I'll do it". or "I'll do it", he said. )
Like many verbs, say can take a to phrase, specifying who the words are said to:
He said it to me.
Say "I'll do it" to her.
This is not an essential argument of say, and you cannot use the special "ditransitive" syntax, as you can for give:
I gave the cake to John = I gave John the cake.
I said the words to John. but not *I said John the words.
Tell has two different possible patterns.
One use is ditransitive, with a direct object for the message, and an indirect object for the person told:
She told a story to the children = She told the children a story.
(The same two patterns as give).
but it can also be used without the message, in which case it is transitive, with the person being the direct object:
She told him but not *She told to him.
Say must have an object (the words said, which can precede if they are directly quoted), and it may have a to phrase; if it does, the to is obligatory.
Tell may have one or two objects. If it has only one, the object is the person told, and to is not allowed.
If tell has two objects, then the message is direct, and the person indirect. The indirect object needs to unless it precedes the direct object (same pattern as give).