If my opponent attacks one of my monsters in face down defense position, and that monster has a flip effect such as "destroy target monster," at what point is the card flipped and the effect takes place? Is it before damage is dealt? If I destroy the attacking monster, is any damage dealt? If the flip effect is "switch target monster to defense mode, and I target the attacking monster, which stats are used in damage calculation?
First I must suggest you give some read to the Rulebook, so you get a better understanding of these basic concepts. What you ask here and more is explained there I think.
Now to answer your questions, the flip effects take effect when the card is flipped up, and that is during the Damage Step.
In few words, when a monster attack that attack can be divided into different Steps (it is a bit different and more complex than this description, so do read the Rulebook to get a better and more accurate understanding):
Attack Declaration: Here you are saying "my monster X attacks your monster Y". At this time bot you and your opponent may take turns on activating and chaining cards and effects to that attack declaration. No flip still
Damage Step: According to the rules this step is divided into:
- Start of Damage Step
- Before Damage Calculation
- Damage Calculation
- After Damage Calculation
- End of Dama Step
The moment Before Damage Calculation is when the monster is flipped if face up. Again, if possible, you and your opponent may take turns activating effects here.
Damage Calculation: This is "main" attack step. Here is where the attack and defense points are added and the result takes place (destroy monsters, inflict damage, etc.). Do notice that even though the attacking monsters was destroyed on Damage Step, the receiving monster will still be destroyed if it has less defense points. This is because destroying the attacking monsters on this step does not cancel the attack that was made; if you want to stop it it should be on Attack Declaration or before.
Another important thing is that the flip effects takes place After Damage Calculation, as per this ruling:
If the attacked monster has an effect that activates when it is flipped face-up (such as a Flip effect), that effect will NOT activate at this time. Its effect will activate after damage calculation, even if the flipped monster itself leaves the Monster Zone before then.
Let's illustrate this with an example of a monster attacking a face down Man-Eater Bug:
Attack is declared. Opponent may activate cards like Mirror Force, or Magical Cylinders here to prevent the attack. If not, we continue...
Damage Step. MEB is flipped up eventually before damage calculation, before that turns of effects may be activated as well, and after this...
Damage Calculation. Here we compare the ATK and DEF of the involved monsters; say MEB had less defense, so it is then destroyed by battle. Any piercing damage is applied, card is sent to GY, and any after effects take place, as the flip effect of MEB which then destroys a monster.