You are the silk cocoon. The spider is pulling you.
Lean against the wall and you will stick and get longer silk string.
Get the string long, at the bottom of the level, in the red zone, and you will have tension to fling at the spider and hurt it.
Don't make the string too long past the red zone or you will damage it.