At a high level, that's close enough.
In actuality, Alice doesn't have Bob's public key, she only has a hash of a hash of the key.
So Alice puts the hash of the hash of the public key in the output of her transaction. Then Bob puts his actual public key in the ScriptSig of the input of the transaction he is creating. All the nodes on the network can then hash the public key that Bob has provided, and then hash that hash. If the result matches the value that Alice put in the output of her transaction, then the public key provided by Bob can be considered to be the public key that is necessary for verifying the signature.
Bob then supplies the signature to show that the spending requirements set by Alice have been met and the value can now be reassigned in a new set of outputs.
Also note that a transaction can have multiple outputs, so the "index" in Bob's transaction indicates which of Alice's possibly multiple outputs are being spent by Bob.