Why the output decreases in series?
Ok. Let's completely ignore the heater for the time being.  Let's also assume a 110V mains voltage powering the bulb.  We'll also treat all the items as simple resistors with no effects of self heating taken into account (purely to keep it simple and not overload you with too much information too soon).

We know voltage, and we know wattage, so we can use:
$$
P = \frac{V^2}{R}
$$
Or, re-arranged for R we have:
$$
R = \frac{V^2}{P}
$$

Immediately from that you should be able to see that as you increase P the R will decrease proportionally.  Still, for completeness, let's work through it for each of the bulbs and the heater:

Let's first substitute in our values:
$$
R_{100} = \frac{110^2}{100} $$$$ R_{40} = \frac{110^2}{40}
$$
Work out those sums and you come up with the values:
$$
R_{100} = 121{\Omega}$$$$R_{40} = 302.5\Omega
$$
So now we know the resistance of the bulbs by themselves.  Add to that another resistance for the heater.  Let's assume it's a 1KW heater.  That, by itself, using the same formula, gives us:
$$
R_H = \frac{110^2}{1000} = 12.1\Omega
$$

Now let's put it in series with each of the light bulbs and work out the power from the heater.  First the 100W bulb:
$$
R_T = 121 + 12.1 = 133.1\Omega
$$
$$
I = \frac{V}{R} = \frac{110}{133.1} = 0.826A
$$
$$
P = R \times I^2 = 12.1 \times 0.826^2 = 8.265W
$$
Now the 40W bulb:
$$
R_T = 302.5 + 12.1 = 314.6\Omega
$$
$$
I = \frac{V}{R} = \frac{110}{314.6} = 0.3497A
$$
$$
P = R \times I^2 = 12.1 \times 0.3497^2 = 1.479W
$$
So you can see a massive reduction in output from the heater with the lower wattage bulb.