At level 40, the bubbles always is the same color around the whole game area. See! The bubbles above the black bubbles are the same colour as the bubbles on the wall! All you need to do is watch the score meter on your bottom right hand and when you have the right amount of points, you just shoot a right colored bubble to kill the level!
Tips from Janice:
I have just re-done level 40 to see which one it is, the trick with this one is to get as many spiders as you can so if you concentrate on the bottom bit just matching 3 bubbles then when you think you have 8 or more spiders there. Look for the line of bubbles either side of the black bubbles on each side, (they are all the same colour ) strike just one side and all the bubbles will drop, but remember you need the spiders to be able to get points for a star.
3 Stars is not easily made at Level 40, but this is how I did it.
Here is another incredible show-off on mastering level 40 by knowing this trick, uploaded to youtube by facebook-spiele.de