Many actors have a facility for making up lines that sound a lot like the playwright's lines - but aren't. It's a valuable skill.
When you're rehearsing
and someone forgets a line
you can't just start cursing.
You have to go on like it's fine.
Sometimes you even have to make something up. Suppose the dialog is like this:
A: Did you shoot him?
Suppose A forgets his line. What is B to do? Probably something like this:
A: (uncomfortable pause)
B: I suppose you're wondering if I shot him. No!
It pays to be glib
when you need to ad lib.