Ответ:

The correct answer is **when**.

**Explanation:** When is used to connect an action that was in progress (playing basketball) with an action that started and interrupted the other action (it began to rain).