Based on this question How would using Thunderwave to stop falling damage work?:
Would casting fly on a creature already in the middle of a fall cause it to take fall damage before it was able to use it's fly speed to move?
Based on this question How would using Thunderwave to stop falling damage work?:
Would casting fly on a creature already in the middle of a fall cause it to take fall damage before it was able to use it's fly speed to move?
The only guidance we get from the rules is the section on Flying Movement in the Combat chapter:
If a flying creature is knocked prone, has its speed reduced to 0, or is otherwise deprived of the ability to move, the creature falls, unless it has the ability to hover or it is being held aloft by magic, such as by the fly spell.
So in a sense, Fly makes you immune to falling. However the rules are silent on whether the creature would stop falling abruptly (which would amount to the same thing as hitting the floor). But we do know Fly doesn't make you immune to effects that move you (e.g. Thunderwave) so that's unlikely to be the case.
In the end it's still going to be the DM's call, just like it's up to the DM to determine whether a fall is so long that it spans multiple turns. The most logical interpretation to me is that the creature would slow to a stop, but at what rate is anyone's guess.
Player's Handbook p183
At the end of a fall, a creature takes 1d6 bludgeoning damage for every 10 feet it fell, to a maximum of 20d6. The creature lands prone, unless it avoids taking damage from the fall.
The important bit here is the intent: At the end of a fall, the creature lands prone (unless it avoided damage). The 'end of a fall' is the landing; no landing, no end of a fall. If you don't land and are no longer falling, the fall didn't 'end' in a way that causes damage.
Of course, the newly flying creature would need to be capable of interrupting its fall before it lands, however, so if it can't move in time to avoid landing, it still lands and takes damage.
If the fall ends for a reason other than landing, the DM has to decide what happens. If the fall was arrested because there was a rope tied around the character's waist, or attached to a climbing harness, then the character might take less damage, or even none. If that rope were around the character's neck instead the character might take much more damage, or even have to save or die.
Is your fall over? Are you somehow immune to falling damage? If the answer is Yes and No, then "ouch".
At the end of a fall, a creature takes 1d6 bludgeoning damage for every 10 feet it fell, to a maximum of 20d6. The creature lands prone, unless it avoids taking damage from the fall.
If you are falling and it ends, you take falling damage. There are some cases where you become immune to falling damage. Featherfall, for example.
Suppose there are some creatures that are falling. If they are not falling later, between those times the fall ended. And when a fall ends, you take falling damage.
The second sentence is about landing. One way to end a fall is to land. If you take falling damage in your fall, and your fall ends in landing, you land prone.
By RAW, the Fly spell does not make you immune to falling damage. Flight in general, especially spells that let you hover, does make it more difficult to fall.
If you end your fall once you are under the influence of the Fly spell, your fall ends. And "At the end of a fall, a creature takes 1d6 bludgeoning damage for every 10 feet it fell, to a maximum of 20d6." you take damage.
So by rules as written, catching yourself with a Fly spell causes falling damage.
Now, it may be reasonable to permit someone able to fly to "catch" someone (or themselves) falling and slow them down gently avoiding the falling damage. But I am unaware of rules in 5e D&D that describe that case, so it would be up to the DM.
Other editions of D&D provide flying creatures limited resistance or immunity to falling damage; I believe 4e explictly grants falling creatures the ability to reduce falling distance by their flight speed. So when you knock a flying creature prone, it "stumbles" to the ground instead of dropping like a stone. 3e D&D even has stall and recover mechanics. Either of these mechanics can be plundered if you need someone else to make up rules for you.
This question boils down to three smaller questions:
Xanather's Guide to Everything now clarifies this in two ways. Firstly, it provides an explicit explanation of the RAW and provides an optional rule for long falls.
The rule for falling assumes that a creature immediately drops the entire distance when it falls. (XGtE)
Using just the standard ruling, no matter how high the person was, they will have already fallen the entire distance before anybody could have a chance to cast fly on them (unless they had a readied action).
However, it also provides an optional rule for long falls that says:
When you fall from a great height, you instantly descend up to 500 feet. If you’re still falling on your next turn, you descend up to 500 feet at the end of that turn. This process continues until the fall ends, either because you hit the ground or the fall is otherwise halted. (XGtE)
In this case, the answer depends on how high the creature is falling from:
Less than 501 Feet - No This case is the same as the standard RAW above; they fall and take damage instantly before fly can be cast.
Greater than 500 feet - Yes In this case the creature would fall 500 feet instantly but not hit the ground since they have not reached it yet. They will not fall the rest of the way until the end of their turn thus giving other and themselves opportunities to halt the fall with fly.
If a flying creature is knocked prone, has its speed reduced to 0, or is otherwise deprived of the ability to move, the creature falls, unless it has the ability to hover or it is being held aloft by magic, such as by the fly spell.
In this description of falling, a creature under the effects of fly are specifically called out as an exception to the rule. Essentially as another person said, a creature under the effects of fly is immune to falling.
This one has no clear answer RAW unfortunately. The creature has now come to a stop because they are now held aloft by magic and thus aren't capable of falling. But they would come to an abrupt halt. In real life, this would cause at least a jerk depending on how fast you were going initially, but D&D is not a simulator.
The ambiguity stems from the fact that "landing" is not defined in-game. However since 5e uses common definitions it is valid to look at those: to land: "to bring to or set on land". Thus, if something is not hitting a solid surface or land it is not landing and if it is not landing then it does not take damage.
I think it is reasonable to assume the fall damage comes from the deceleration against a solid object and that, as such, no damage is warranted here since there is no solid object stopping the fall. There is nothing describing how fast a person coming under a fly spell decelerates, so it would be misleading to assume it is either rapid enough to cause damage or slow enough not to. Could be either or could be in between. This is the way I would adjudicate this. However, as there is no RAW on this, the DM will have to adjudicate it as they see fit.
tl;dr The only way this would work would be using the optional rule from XGtE and casting fly on a creature falling from greater than 500 feet.
Casting "Fly" on a creature gives them voluntary control over their movement in the air; they can easily slow or redirect their speed instead of slamming to a sudden stop.
If you cast it in such a manner that the spell completes only a few feet from the ground, they might need a dex save to "miss the ground", considering built up speed and direction of travel, but that's an edge case, and regardless, if they remained alive/conscious upon hitting the ground, could return to the air during their next movement phase.
In the linked question, Thunderwave causes a "wave of thunderous force" to violently smack the target(s) away. The wave of force also deals damage in passing, like a shockwave from an explosion; it's simply damage coming from a second direction, not something which would effectively stop the fall.
While the rules are brief, to the point of being slightly vague, it's a situation where the authors return to classical styles of adjudication and expect the DM to make a call based on common sense.
A "gentle stop" (or simply avoiding hitting something entirely) causes no damage -- dropping a tissue paper held high to the floor causes it to fall slowly, and the impact with the ground causes damage so slight as to be imperceptible.
A "hard stop" is the actual source of the damage -- instead of the tissue paper, drop an uncooked egg. The difference is messily obvious.